Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter NineDialog Functions (continued)

EditGetText Function

Overview

The EditGetText retrieves ANSI text from an edit or static text control either in direct and in validation modes.

Syntax/Parameters

Syntax

string = EditGetText ( int id, [string name], [int flags], [int size] );

Parameters

id

An int containing the control ID of an edit or static control.

name

An optional string specifying the name of the control. When specified, the function switches to validate mode and will test the content of the retrieved string according to the flags.

flags

An optional int specifying validation parameters for the type of field. If omitted, the value is set to zero.

size

An optional int specifying the maximum size of the field in characters.

Return Value

Returns a string containing the text or an empty string on failure or if the control does not contain any text. Use the GetLastError function to retrieve error information. In validation mode, the last error code will contain the control ID which can be returned directly to the dialog validate procedure to set focus on the offending control.

Remarks 

Though the EditGetText function is intended for use with edit controls, it will actually work on most control classes. Because an empty string does not necessarily indicate an error, the GetLastError function should be used to determine if the function failed.

If validation is enabled and validation fails, a standard message box will be displayed describing the error with the name of the field. The caller can pass the error code back from the validation procedure to set focus on the control containing the error.

The validation flags are as follows (bitwise combinations):

  Definition   Bits   Description  
  General          
    EGT_FLAG_REQUIRED   0x80000000   Field Is Required  
    EGT_FLAG_DO_NOT_TRIM   0x40000000   Don’t Trim Spaces  
  Field Types          
    EGT_FLAG_TYPE_MASK   0x0F000000   Mask for Type  
    EGT_FLAG_STRING   0x00000000   General String (no test)  
    EGT_FLAG_NUMERIC   0x01000000   Numeric Field  
    EGT_FLAG_ACCOUNTING   0x02000000   Accounting Style Field  
    EGT_FLAG_CURRENCY   0x03000000   Currency Field  
    EGT_FLAG_HEX   0x08000000   Hex Field (0x000000)  
  Field Options          
     String as File Options          
    EGT_FLAG_FILE_MODE_MASK    0x00000FFF   File Modes are Used (mask)  
    EGT_FLAG_FILE_MUST_EXIST    0x00000001   Check for existing file  
    EGT_FLAG_FILE_CAN_OPEN_READ   0x00000002   Check for file can be opened as read  
    EGT_FLAG_FILE_CAN_OPEN_WRITE    0x00000004   Check for file can be opened as write  
    EGT_FLAG_FILE_QUERY_OVERWRITE    0x00000008   Query for file overwrite  
    EGT_FLAG_FILE_PATH_REQUIRED    0x00000010   Must have a path (must be qualified)  
    EGT_FLAG_FILE_REQUIRES_EXTENSION    0x00000020   Requires a filename extension  
    EGT_FLAG_FILE_LOCAL_PATH    0x00000040   String cannot be URL, must be local  
    EGT_FLAG_FILE_PATH_MUST_EXIST    0x00000080   Specified path must exist  
     Numeric Options          
    EGT_FLAG_NO_ZERO   0x10000000   Zero not allowed  
    EGT_FLAG_UPPER_LIMIT   0x20000000   Upper limit on value (embed or void)  
    EGT_FLAG_NEGATIVE   0x40000000   Negative value allowed  
    EGT_FLAG_UPPER_LIMIT_MASK   0x00FFFFFF   Upper limit value mask  
     String Options          
    EGT_FLAG_FILE_MUST_EXIST    0x00000001   Check File for Existing File   
    EGT_FLAG_FILE_CAN_OPEN_READ    0x00000002   Check File can Open as Read (tests for exists as well)  
    EGT_FLAG_FILE_CAN_OPEN_WRITE    0x00000004   Check File can Open as Write   
    EGT_FLAG_FILE_QUERY_OVERWRITE    0x00000008   Query Overwrite   
     File Operations (as string)          
    EGT_FLAG_FILE_MODE_MASK   0x00000FFF   File Modes are Used  
    EGT_FLAG_FILE_MUST_EXIST   0x00000001   Check File for Existing File  
    EGT_FLAG_FILE_CAN_OPEN_READ   0x00000002   Check File can Open as Read  
    EGT_FLAG_FILE_CAN_OPEN_WRITE   0x00000004   Check File can Open as Write  
    EGT_FLAG_FILE_QUERY_OVERWRITE   0x00000008   Query Overwrite  
    EGT_FLAG_FILE_PATH_REQUIRED   0x00000010   Must Have a Path  
    EGT_FLAG_FILE_REQUIRES_EXTENSION   0x00000020   Requires a File Extension  
    EGT_FLAG_FILE_LOCAL_PATH   0x00000040   String Cannot be URL  
    EGT_FLAG_FILE_PATH_MUST_EXIST   0x00000080   Specified Path Must Exist  
     Accounting Type          
    EGT_FLAG_ACCOUNTING_ALLOW_ALL   0x000000F0   Cover All Modes  
    EGT_FLAG_ACCOUNTING_ALLOW_DECIMAL   0x00000010   Allow Decimal  
    EGT_FLAG_ACCOUNTING_ALLOW_COMMAS   0x00000020   Allow Commas  
    EGT_FLAG_ACCOUNTING_ALLOW_NEG_DASH   0x00000040   Allow Negative as -  
    EGT_FLAG_ACCOUNTING_ALLOW_NEG_HOLE   0x00000080   Allow Negative as ()  

 

For edit controls, the maximum size of the text field will be limited by the physical size of the control unless the ES_AUTOHSCROLL style is set.

Proper security precautions should be employed when storing and using sensitive information such as passwords. This function abides by the Secure Memory Model.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic

Page revised 2024-12-13