|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > JSON - Parser > Parser-Operations > !Library State and Settings > PSJ. - JSON Operations |
SPR Script Language
PSJ.GetClipOutput
Gets the current state of the automatic clipboard output setting.
Intention
The PSJ.GetClipOutput command queries the JSW library to determine if the automatic copying of WSTRING results (like those from PSJ.ToString or extraction commands) to the system clipboard is currently enabled or disabled. It returns the state as a numeric code (1 for enabled, 0 for disabled), optionally storing it in a variable.
Illustration
📝 Assuming clipboard output is enabled:
PSJ.GetClipOutput|$$STATE
Result: $$STATE will be set to "1".
📝 Assuming clipboard output is disabled:
PSJ.GetClipOutput|$$STATE
Result: $$STATE will be set to "0".
Syntax
PSJ.GetClipOutput[|$$RET_CODE]
Parameter Explanation
P1 - $$RET_CODE - (Variable, Numeric, Optional)
The variable where the result code will be stored.
- 1: Clipboard output is Enabled.
- 0: Clipboard output is Disabled.
If omitted, the state is returned but not stored in a variable.
Technical Background
This command directly calls the W_JSON_GetClipOutput() function from the JSW library. This function retrieves the value of the internal state flag (g_JSON_ClipOutput) which determines if the W_JSON_HandleResultOutput helper function will attempt to copy WSTRING results to the clipboard.
Examples
'***********************************
' Sample: Check clipboard state
PSJ.GetClipOutput|$$CLIP_ENABLED
IFE $$CLIP_ENABLED == 1 THEN
PRT.Clipboard output is ON
ELSE
PRT.Clipboard output is OFF
END
MBX.Ready
'***********************************
Remarks
- This command retrieves the setting controlled by PSJ.SetClipOutput.
- The underlying JSW library function returns a BYTE, but the SSPR command sets a standard numeric variable.
Limitations
- None specific to this command, beyond the library needing to be initialized.
See also: