Function Set() Foundation
Changes and/or reads a system setting.
Set( <nDefine>, [<xNewSetting>], [<lAdditive>] ) --> xOldSetting
When Set() is called without the argument <xNewSetting>, the function returns the current system setting designated by <nDefine>. If <xNewSetting> is specified, the corresponding system setting is set to <xNewSetting> and the value of the old setting is returned.
The environment function Set() reads and/or changes system settings or variables. The settings are identified by a numeric value which should always be specified as a symbolic constant. The symbolic constants are defined in the header file Set.ch. For almost every Set(<nDefine>) call there is a command or function which reads and/or changes only that single setting. Instead of Set(), the individual commands are preferred.
The following table lists the valid constants which can be used for <nDefine>. The accompanying data types for <xNewSetting> and the corresponding commands are listed next to each one. More exact information about the individual Set() settings can be found with the respective command or function.
The settings are grouped by scope, which is relevant when a program uses multiple threads. If settings with process-wide scope are changed in a thread, the new setting is valid for the entire process, or all threads. Settings with thread-local scope can be set individually for different threads. If a new thread is started, it inherits the thread-local settings from the thread it is started from. An exception is the SET CHARSET setting used for screen output. Character strings are always displayed according to the SET CHARSET setting of the main thread. String manipulation in memory, however, can be performed by two threads having different SET CHARSET settings.
|Value data type
|SET ALTERNATE TO
|SET DELIMITERS TO
|SET PRINTER TO
|Value data type
Passing the constant _SET_COLLATION to the Set() function allows for the activatation of a pre-defined or user-defined collation table for modifying the sorting order of characters. The parameter <xNewSetting> is either a constant from the COLLAT.CH file, or a one dimensional array with 256 elements. The ASCII value of a character plus 1 defines the array element that contains the weighing factor for a character (see the third example).
This setting is only recognized on Windows 95/98 platforms. It controls the timeout value in seconds for accessing a printer using text-mode printing routines (e.g. @...SAY, DevOut(), ?, ??). The default is 60 seconds. This is the maximum waiting period for the operating system to receive a printer response. If the printer does not respond within this time interval, a runtime error is raised. Note, however, that the timeout is independent of the printer status. If, for whatever reason, a printing operation cannot be completed within the timeout interval, a runtime error is raised even if the printer is printing or is ready to print. In addition, if an @...SAY command is directed to a printer, it may not return until the timeout has elapsed when the printer is not ready.
No accompanying command exists for _SET_EXTRAFILE. This constant indicates an additional SET ALTERNATE file.
Set the default hash algorithm to be used by the function Char2Hash().
This setting exists for compatibility reasons only. It allows for suppressing the automatic event handling while text-mode functions or commands like Achoice(), Memoedit(), GET/READ etc. are active. The setting defaults to .T. (true). When it is set to .F. (false), GUI controls mixed with text-mode controls will not respond to events while a text-mode function or command having an internal event handler is executed.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.