UDF (User-Defined Functions)
Top  Previous  Next

(UDF ('exe-name','parameter-list'))
(UDF ('-
exe-name','parameter-list'))
(UDF ('+
exe-name','parameter-list'))

You can use a user-defined function (UDF) anywhere you can use a function in R:BASE:
Forms
Reports
Entry/exit procedures
Applications

The arguments for a UDF are as follows:

+, -, or nothing
If you do not specify a plus or minus, the function is hidden when it runs; this setting is the default. A plus (+) runs the function in a normalized window. A minus (-) runs the function as a minimized icon.  

exe-name
Specifies the name of the UDF (the name of the executable file into which you have compiled and linked your program). This cannot be a Windows program; UDFs can only be DOS or OS/2 programs.  

parameter-list
Specifies a text string that is sent to DOS. Multiple parameters must be separated by spaces, as shown:  
 
SET VAR v1=(UDF('random','25 345'))  
 
clip0001
* If the operating system is DOS, this will be passed as an address. If the operating system is OS/2, this will be passed to a shared-memory segment.  

UDFs function as follows: R:BASE passes command line arguments to the UDF.EXE file. The UDF.EXE file completes its calculations and passes the data and the ERRORLEVEL to R:BASE.

Two files, which are provided with R:BASE for Windows, facilitate this process: RBGUDF.EXE and RBGUDF.PIF. With these files present, DOS error variables can successfully be passed to R:BASE for Windows applications for processing.