<<

Contents

Search

>>

 

ADD_FIELD

 

 

Function

 

 

Syntax:

ADD_FIELD(<Separator>,<Attribute String>,<Variable>[,<Macro Before>][,<Macro After>][,<Handle>])

 

<Separator>

= <STRING-EXPRESSION>

<Attribute String>

= <STRING-EXPRESSION>

<Variable>

= <VARIABLE_NS>

<Macro Before>

= <MACRONAME>

<Macro After>

= <MACRONAME>

<Handle>

= <NUM-EXPRESSION>

 

 

Meaning:

With the function ADD_FIELD additional input fields (buttons, checkboxes, etc.) can be created dynamically on masks as well as in windows that have been created by the instruction WINDOW. 

 

<Handle> specifies in which window the mask field is to be created. <Handle> can contain the window depth or the handle of a split window or a WINDOWCALL window. If the parameter <Handle> is missing, the mask field is created on the current mask.

 

The created mask field is always inserted at the end of the field sequence behind all the already existing mask fields. The field sequence can be changed with the function CHANGE_FIELDSEQUENCE .

 

If mask fields are inserted in a window that has been created with the instruction WINDOW, the field processing must be started by the function START_FIELD.

 

ADD_FIELD returns the result 0 if no error occurred, otherwise it returns one of the following error numbers:

 

Error number

Meaning

-1

No mask found

6101

Invalid field type

6102

Invalid line number

6103

Invalid column number

6104

Length of the formatting string and length of the file field are different

6105

Faulty post decimal positions

6106

Post decimal positions of the file field do not match the post decimal positions of the formatting string.

6107

Double decimal point in the formatting string

6108

Only J, Y or N allowed with signs

6109

Only J, Y or N allowed with blinking

6111

Only J, Y or N allowed with changeable

6113

Only G,K,C,L,A allowed with capitalization/ writing in small letters

6114

Only J, Y or N allowed with symbols/ special characters

6115

Invalid key for scrolling

6116

Only J, Y or N allowed with automatic field end

6125

ADD_FIELD not allowed on the specified mask

6126

Variable does not fit to formatting string

6127

Formatting string is faulty

6129

Separator is missing

6133

Valid character is missing with the radiobutton

6134

Other attributes are faulty

6135

The semi-colon is not a valid separator

 

Parameter:

Separator

The first character of Separator specifies the separator by which the entries in <attribute string> are separated. The semi-colon ';'  is not a valid separator since it is used as separator in the other attributes.

 

Attribute String

Contains the attributes of the mask field separated by Separator. The attributes must be given in the order shown below. Empty entries are possible. 

Number

Attribute

Meaning

1

Field Type

F = numeric field, alphanum. Field or date field

E = Editfeld

B = Pushbutton

C = Checkbox

R = Radiobutton

O = Scrollbar

M = Combobox

L = Listbox

T = Static text

2

Field Height

Specifies the height of the field as multiple of the line height. This attribute only has a meaning with field type = E, B, P, C, R, O, L, T.

 

If field type = B, P, C or R and no field height is specified, the height specified by the variables EBUS_PUSHBUTTON, EBUS_CHECKBOX$ or EBUS_RADIOBUTTON$ .

 

If the field height <= 0, the standard field height 1.5 applies to Type  B and P, otherwise 1.

3

Number Input Characters

This attribute only has a meaning with type = F, A, E, M.

 

The number of valid input characters is specified. If number of input characters <= 0 or empty, the number of input characters is specified by the formatting string  (Attribute number 6) .

4

Row

Row position of the mask field.

5

Column

Column position of the mask field.

6

Formatting String

e.g. &&&&& or $$,$$#.##

 

Specifies the formatting and the type of the mask field (numeric, alphanumeric, date). The following format characters are possible:

 

& alphanumeric character

$ numeric character with zero suppression

# numeric character without zero suppression

^ date character

 

With numeric fields with post decimal positions a point '.' must be used as decimal point.

7

Negative Values allowed

Only has a meaning with numeric fields. The following values are possible: J, Y, N. The empty entry is equivalent to N.

8

Blink

The following values are possible: J, Y, N. The empty entry is equivalent to N.

9

Changeable

The following values are possible: J, Y, N. The empty entry is equivalent to N.

10

Capital Letters/
Small Letters /
All

Only has a meaning with alphanumeric fields. The following values are possible: G, K, C, S, A. The empty entry is equivalent to A.

11

Special Characters

Only has a meaning with alphanumeric fields. Folgende Werte sind möglich: J, Y, N. Der leere Eintrag ist gleichbedeutend mit J.

12

Automatic End of Field

The following values are possible: J, Y, N. The empty entry is equivalent to N.

13

Scroll in Key

Specifies the key number for scrolling with Index File fields.

14

Allowed Characters

Only has a meaning with alphanumeric fields. The valid input characters are to be specified. With an empty entry all characters are allowed.

 

With Radiobuttons (Typ = R) the first character of the valid input characters specifies the character which is assigned to the radiobutton variable when the radiobutton is activated.

15

Help Text

Specifies the text to be displayed when the mouse cursor is over the field.

16

Additional Field Attributes

The attributes must be separated by semi-colon ';' .

 

Other attributes with field type E and F:

No.

Content

1

Border

2

Text Alignment: L/Z/C/R
L = Left
Z = Centered
C = Centered
R = Right

3

Multiline: J/Y/N

4

Not Changeable: J/Y/N

5

Horizontal Scrollbar: J/Y/N

6

Vertical Scrollbar J/Y/N

7

Password Field: J/Y/N

8

Automatic Line Wrap: J/Y/N

9

Word Wrap: J/Y/N

10

Transparent: J/Y/N

 

Other attributes with field type B, C and R:

No.

Content

1

Type of Image: K/N/S/I
K = No Image
N = No Image
S = Standard Image
I = Individual Image

2

Number of Standard Image (Only with image type S)

3

Name of image, name of image pressed, name of image over only with image type I.

4

Placement of Image: L/M/C/R
L = Left
Z = Centered
C = Centered
R = Right

5

Size of Image: O/A/T

O = Original Size
A = Adapted
T = Total

6

Defaultpushbutton: J/Y/N (Only with field type B)

7

Text position: L/M/C/R
c

 

Other attributes with field type O:

No.

Content

1

Orientation: H/V
H = Horizontal
V = Vertical

2

Range from

3

Range to

4

Page Size

 

Other attributes with field type L:

No.

Content

1

Border

2

Multiple Selection: J/Y/N

3

Sort: J/Y/N

4

Horizontal Scrollbar: J/Y/N

5

Vertical Scrollbar: J/Y/N

6

Preallocation: V/T
V = Variable
T = Text

7

Preallocation Filename

8

Preallocation Field Name

9

Preallocation Text

Note: The single elements must be separated by "|" .

 

Other attributes with field type M:

No.

Content

1

Border

2

Sort: J/Y/N

3

With Edit Field: J/Y/N

4

Preallocation: V/T
V = Variable
T = Text

5

Preallocation Filename

6

Preallocation Field Name

7

Preallocation Text

Note: The single elements must be separated by "|" .

8

Height in Lines

 

Other attributes with field type T:

No.

Content

1

Border

2

Text Alignment: L/Z/C/R
L = Left
Z = Centered
C = Centered
R = Right

3

Color of Border red (Only with border = 1)

4

Color of Border green (Only with border = 1)

5

Color of Border blue (Only with border = 1)

6

Multiline: J/Y/N

 

17

Label

This attribute only has a meaning with field type C and R.

The designation of the checkbox or the radiobutton is specified.

18

Color / Font

The attributes must be separated by semi-colon ';' .

 

No.

Content

1

Standard Textcolor: J/Y/N

2

Textcolor  red

3

Textcolor green

4

Textcolor blue

5

Standard Background Color

6

Background Color red

7

Background Color green

8

Background Color blue

9

Standard Font: J/Y/N

10

Font Name

11

Standard Font Size: J/Y/N

12

Font Size in Rows

13

Font Size in Point

14

Bold: J/Y/N

15

Italic: J/Y/N

 

 

Variable

Variable that is linked to the mask field.

 

If ADD_FIELD is executed in a function, a dimensionized variable must be used, otherwise local variables from the function are used, which do not exist anymore after the function has been terminated.

 

Macro Before

Macro Before of the mask field.

 

Macro After

Macro After of the mask field.

 

Handle

Window depth or handle of a split window or handle of a WINDOWCALL Window

 

Sample:

/* Create a Button

B$ = "Button"

H$ = "B|1.5|0|10|2|&&&&&&&&&&|N|N|J|A|N|N|||Button Helptext|S;4;;L;A;N;R"

 

H% = ADD_FIELD("|",H$,B$,,)

 

IF H% <> 0

THEN ... Error...

ENDIF

 

See also:

DEL_FIELD

START_FIELD

MOVE_FIELD