Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter NineDialog Functions (continued)

EditGetUnicode Function

Overview

The EditGetUnicode retrieves the Unicode text from an edit or static text control either in direct and in validation modes.

Syntax/Parameters

Syntax

wstring = EditGetUnicode ( 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 wstring 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_CURRENCY   0x02000000   Currency Field  
    EGT_FLAG_HEX   0x07000000   Hex Field (0x00000000)  
  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   

 

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