| Name: | CVAL | Syntax: | (CVAL('arg')) |
|---|---|---|---|
| Family: | Function | Category: | Keyboard and Environment |
| Description: | Current Value | ||
(CVAL('arg')) returns the current value or setting of 'arg'. You must either enclose the keyword in quotation marks or use a dot variable that has a TEXT data type to which you have assigned the keyword. You can use all SHOW and SET keywords, such as the character settings IDQUOTES or such as MULTI, as well as the following:
| CONNECTIONS | CURRDIR | CURRDRV |
| DATABASE | DBPATH | FORM_ALIAS |
| FORM_CAPTION | FORM_DATA | FORM_DATA_TYPE |
| FORM_FIELD_NAME | FORM_NAME | FORM_TABLE |
| PLATFORM | VERSION BITS | VERSION BUILD |
| VERSION SYSTEM |
In the following example, the value of vcval is OFF if the value of MULTI is set to off.
SET VAR vcval = (CVAL('MULTI'))
In the following example, the user keyword is loaded into a variable and then the variable is used in the CVAL function. It returns the current user.
SET VAR vword text = 'USER' SET VAR vuser = (CVAL(.vword))
For more information about SHOW keywords, see the "SHOW" entry.
For more information about SET keywords, see the "SET" entry.
Additional CVAL Functions in R:BASE 2000 (ver 6.5++) for Windows:
(CVAL('CurrentPrinter'))
Returns the name of selected windows printer for current R:BASE session using PRNSETUP 'Printer Name' command. If no PRNSETUP 'Printer Name' command was issued, then, R:BASE for Windows will default to the windows default printer.
(CVAL('Printers'))
Returns the list of all installed printers.
(CVAL('WindowsPrinter'))
Returns the windows default printer.
(CVAL('Drives'))
Returns the list of currently available drives, including the mapped network or removable drives.
Example:
SET VAR vDrives = (CVAL('Drives'))
vDrives will include the list of ALL drives!
Result: aCDeF
In that list of drives, drives with CAPITAL letters, such as C,D or F would be the hard disk drive, and drives with lower case letters would be removable drives, such as a or e.
a = floppy disk drive
C = Hard Disk
D = Hard Disk/CD-ROM/DVD
e = zip disk
F = Hard Disk/CD-ROM/DVD or even mapped network drive
All hard drives, including CD-ROM/DVD and network mapped drives would be CAPITAL letters.
All removable drives, including floppy disk drives and zip drives would be
lower case letters.
(CVAL('ScreenSize'))
Returns the screen area in pixels.
(CVAL('ClipboardText'))
Returns the contents of the Windows clipboard.
(CVAL('UserID'))
Returns the Windows User ID
(CVAL('NetUser'))
Returns the currently logged-in network user name.
(CVAL('Computer'))
Returns the name of your computer.
(CVAL('UserDomain'))
Returns the name of logged-in network domain.
(CVAL('Error Variable'))
Title says it all.
(CVAL('Last Error'))
This is an alternative to the current ERROR VARIABLE system of -ERROR- trapping. Something more along the lines of an error variable which must be EXPLICITLY CLEARED.
Why? The current system does not allow error trapping in nested code segments or large blocks of code. Furthermore, since the -ERROR variable is automatically cleared after each command, it requires error trapping logic immediately after each command.
(CVAL('Error Detail'))
When an -ERROR- occurs now you can track additional information including the name of the file being run and the byte offset within the file. If the thing being run is a procedure it saves information on the select used to fetch the procedure too. We have implemented a new method of simple "stack" to keep the last three errors. To see the information tracked use this new CVAL option.
SET VAR vError = (CVAL('Error Detail'))
Each time you call this particular CVAL function the stack pointer decrements so successive calls allow you to see all three errors. Call it a fourth time and you will see the first one again, etc.