Description

The Rev_Utility function provides an API for various operating system functions.

Syntax

returnValue = Rev_Utility( method, p1...p6 )

Parameters

The function has the following parameters:

ParameterDescription
methodA valid Rev_Utility method. BORDERWIDTHS, ERRORTEXT, FSERROR, GETSYSTEMFONTS, SETREADONLY, SETWINDOWSIZE, SYSTEMSIZE, TOKENIZE, VERIFYPROC.
param1...Each method has different parameter requirements.
param6 
Methods
ValueDescription
BORDERWIDTHSThis method examines the style of the window passed in first parameter and returns the width of the window borders for that particular style.
ERRORTEXTThis method returns the error text associated with an error code. The error code/error text must exist within the REVERROR.DAT file.
FSERRORWhen an error has occurred this message may called to return the error details to the calling routine.
GETSYSTEMFONTSReturns an @fm-delimited list of fonts used in the current theme.
SETREADONLYThis method sets or unsets a control's read only style.
SETWINDOWSIZEThis method sets a window's SIZE without altering it's visibility.
SYSTEMSIZEThis method returns the SIZE of the desktop area as reported by the system.
TOKENIZEThis method tokenizes a string based upon a set of passed delimiters.
VERIFYPROCThis method validates if a procedure name is a valid system program.
Parameters
MethodParameters
BORDERWIDTHSA Window Name, e.g. EXAMPLES_MAIN
ERRORTEXTAn Error Code as defined in the REVERROR.DAT file. e.g. FS100
FSERRORNull
GETSYSTEMFONTSNull

SETREADONLY

ParameterDescription
param1An @fm-delimited list of controls.
param2A boolean value.

When TRUE$ all the controls in p1 are set to ReadOnly. When FALSE$, the ReadOnly is turned off for all the controls in p1.

 

SETWINDOWSIZE

ParameterDescription
param1The Window Name.
param2An @fm delimited array.

<1> X (offset from the left side of the screen) <2> Y (offset from the top of the screen) <3> W (Width of the window) <4> H (Height of the window)

 
SYSTEMSIZENull
TOKENIZE 
VERIFYPROC 

Returns

MethodReturn Value
BORDERWIDTHSAn @fm-delimited array of window borders for the particular style.

<1> The height of the horizontal border of a window frame. <2> The height of the vertical border of a window frame. The values returned are in pixels.

ERRORTEXTThe Error description for the corresponding error code in the REVERROR.DAT file.
FSERRORThe FSError and description from the REVERROR.DAT file.
GETSYSTEMFONTSReturns an @fm-delimited list of fonts used in the current theme.

<1> Caption Font <2> Small Caption Font <3> Menu Font <4> Status Font <5> Message Font

SETREADONLYNull
SETWINDOWSIZENull
SYSTEMSIZEThe size of the desktop area, after allowing for the system tray and other toolbars.

<1> X (offset from the left side of the screen) <2> Y (offset from the top of the screen) <3> W (Width of the available desktop) <4> H (Height of the available desktop)

TOKENIZEThis method tokenizes a string based upon a set of passed delimiters.
  • // The string is also checked to see if quotes are balanced.
VERIFYPROC 

Examples

* BORDERWIDTHS Example
borderWidths = Rev_Utility("BORDERWIDTHS","EXAMPLES_MAIN")
hBorder = borderWidths<1>
vBorder = borderWidths<2>
 
*FSERROR Example
Open "JIMMY_TWO_TIMES" To f_jimmy_2x else
    error = Rev_Utility( "FSERROR" )
end
* The error returned if the file does not exist is:
* FS401 - The "JIMMY_TWO_TIMES" table has not been created or attached.
 
* GETSYSTEMFONTS Example
systemFonts = Rev_Utility("GETSYSTEMFONTS")
 
* ERRORTEXT Example
Open "JIMMY_TWO_TIMES" To f_johnny else
   errorCode = @file.error<1>
   errorText = Rev_Utility( "ERRORTEXT", errorCode )
end
/* The errorText variable should be
401 - The "%1%" table has not been created or attached.
*/
* SETREADONLY Example
* Set all the controls on a form to Read Only.
Ctrlmap = Get_Property(@window, "CTRLMAP")
x = Rev_Utility( "SETREADONLY", ctrlmap, TRUE$)
  • No labels