Kbase P97781: How to programatically retrieve Progress version, including service pack and temporary fix levels by
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/18/2004 |
|
Status: Unverified
GOAL:
How to programatically retrieve Progress version, including service pack and temporary fix levels ?
FACT(s) (Environment):
OpenEdge 10.x
Progress 9.x
FIX:
The following sample code reads <DLC>/version file to retrieve the Progress version infomation.
/* ts-version.p - BEGIN */
DEF VAR cVersion AS CHARACTER.
DEF VAR cTmp AS CHARACTER.
FILE-INFO:FILE-NAME = "version".
cVersion = FILE-INFO:FULL-PATHNAME.
INPUT FROM VALUE( cVersion ).
IMPORT UNFORMATTED cTmp.
INPUT close.
ctmp = ENTRY( 3, ctmp, ' ' ).
IF NUM-ENTRIES( ctmp, '.' ) = 1 THEN
ctmp = ENTRY( 4, ctmp, ' ' ).
MESSAGE
"Version:" ctmp SKIP
"Major version:" ENTRY( 1, ctmp, '.' ) SKIP
"Minor version:" SUBSTRING( ENTRY( 2, ctmp, '.' ), 1, 1 ) skip
"Maintenance release:" SUBSTRING( ENTRY( 2, ctmp, '.' ), 2, 1 ) SKIP
"Service pack:" SUBSTRING( ENTRY( 2, ctmp, '.' ), 3, 2 ) SKIP
"TFix:" SUBSTRING( ENTRY( 2, ctmp, '.' ), 5 )
VIEW-AS ALERT-BOX.
/* ts-version.p - END */