Consultor Eletrônico



Kbase P20391: How to get the 4GL session font names
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   03/03/2003
Status: Unverified

GOAL:

How to get the 4GL session font names

GOAL:

How to use the GET-KEY-VALUE statement to get the session font names

GOAL:

How to know how many fonts are there defined in the 4GL session

GOAL:

How to use the FONT-TABLE system handle

FACT(s) (Environment):

Progress 8.x

FACT(s) (Environment):

Progress 9.x

FIX:

The following example loads the fonts defined in the 4GL session in a combo-box object.

DEFINE VARIABLE cFont AS CHARACTER NO-UNDO.
DEFINE VARIABLE iFont AS INTEGER NO-UNDO.

ASSIGN /*Delete the combo items*/
coFonts:LIST-ITEM-PAIRS = ?

/*The font names have the ',' character in it, therefore
the delimiter is changed to CHR(1)*/
coFonts:DELIMITER = CHR(1).

/*Scan the fonts defined in the 4GL session*/
REPEAT iFont = 0 TO FONT-TABLE:NUM-ENTRIES - 1:

/*Gets the font description using the font number*/
GET-KEY-VALUE SECTION "FONTS" KEY "Font" + STRING(iFont) VALUE cFont.

/*Adds the font to the combo-box*/
coFonts:ADD-LAST(cFont, STRING(iFont)).

END.