#DEFAULT (default procedure starting point) 

Top  Previous  Next

 

#DEFAULT

    procedure

#ENDDEFAULT

#DEFAULT

Begins a default procedure declaration section.

procedure

Default procedure in .TXA file format.

#ENDDEFAULT

Terminates the default procedure declaration.

The #DEFAULT structure contains a single default procedure declaration in .TXA format as generated by the Application Generator's Export function. #DEFAULT may only be placed at the end of a #PROCEDURE section. You may have multiple #DEFAULT structures for a single #PROCEDURE. The enclosed procedure section of a .TXA file should contain a procedure of the preceding #PROCEDURE's type. The recommended way to create a #DEFAULT structure is to edit the default procedure in the template registry, and then export the template as text, which creates a .TXA file.

Structure Attributes

#ORDINAL(number)

#ORDINAL stores a unique ID number for every control populated in the window.

You can consider #ORDINAL values as roughly equivalent to a "Primary Key" value. Change or delete them and your "data" is no longer properly linked to related entities. Since #ORDINAL values are relatively new to this version, there is no legacy reason to need to touch them, and you should not delete or change their values.

When copying controls in the window structure source code, the #ORDINAL attribute should be removed from the copied control. A control without the #ORDINAL attribute is treated as a "new" control. You shouldn't change the value of the #ORDINAL attribute for a control that wasn't copied,nor copy a control, and leave its #ORDINAL as the same value as the original control.

 

#ORIG(ControlName)

#ORIG stores the original control name populated by a template. When a control that already exists is populated, or a control is copied in the window or report, the control will be automaticaly renamed, but #ORIG will store the original name.

 

#SEQ(number)

#SEQ is used to link a control to a template. The number represents the template instance number.

 

#FIELDS(field1,field2,fieldn)

The #FIELDS attribute stores the fields to be showed in each column on a populated LIST control.

 

#LINK(control name)

The #LINK statement, when added to a control will link the control to a specific template family. When the linked control is deleted the window formatter also will delete any matching control containing the #LINK attribute. This is used primarily with prompts and entry controls, or radio buttons, or in some templates like the UpdateButtons where the Insert,Change & Delete buttons are linked to each other.

 

Example:

#DEFAULT

NAME DefaultForm

[COMMON]

DESCRIPTION 'Default record update'

FROM Clarion Form

[PROMPTS]

%WindowOperationMode STRING  ('Use WINDOW setting')

%INISaveWindow LONG  (1)

[ADDITION]

NAME Clarion SaveButton

[INSTANCE]

INSTANCE 1

PROCPROP

[PROMPTS]

%InsertAllowed LONG  (1)

%InsertMessage @S30  ('Record will be Added')

%ChangeAllowed LONG  (1)

%ChangeMessage @S30  ('Record will be Changed')

%DeleteAllowed LONG  (1)

%DeleteMessage @S30  ('Record will be Deleted')

%MessageHeader LONG  (0)

[ADDITION]

NAME Clarion CancelButton

[INSTANCE]

INSTANCE 2

[WINDOW]

FormWindow WINDOW('Update Records...'),AT(18,5,289,159),CENTER,SYSTEM,GRAY,MDI

           BUTTON('OK'),AT(5,140,40,12),USE(?OK),DEFAULT,#ORDINAL(1),#SEQ(1),#ORIG(?OK),#LINK(?Cancel)

           BUTTON('Cancel'),AT(50,140,40,12),USE(?Cancel) ,#ORDINAL(2),#SEQ(2),#ORIG(?Cancel)

           STRING(@S40),AT(95,140,,),USE(ActionMessage),#ORDINAL(3)

          END

#ENDDEFAULT