Hitachi

JP1 Version 11 JP1/Script Description and Reference (For Windows Systems)


8.2.6 GetGV (get a global variable)

Purpose

Gets a global variable. In JP1/Script 05-00 and later versions, this command allows you to get a global variable on a remote computer.

Syntax
GetGV (GlobalName [, CompName])
Arguments
GlobalName

Write the global variable name as a character string or as a variable that stores this value.

CompName (from version 05-00)

Write the name of the computer on which this global variable resides, using a character string or a variable that stores this value.

This value is optional. If you omit this value, the computer on which the command is executed is assumed.

Note that JP1/Script must be installed and the JP1/Script service must be running on the remote computers to be specified. For details about accounts for accessing computers, see 2.2 Accounts for communication with other computers.

Description

The GetGV command acquires a specified global variable and returns its value. If you specify a non-existent global variable, a zero-length string ("") is returned.

If you specify a remote computer in CompName and want to include n double quotation marks (") as characters in GlobalName, you must enter n*4 double quotation marks. However, If you specify 1 in the following registry, you can use n*2 double quotation marks instead of n*8:

Registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Hitachi\JP1/Script\SPTX
Value name
ParseDQ
Value datatype

REG_DWORD

Value

0: If you are using quotation marks in a parameter string, the setting that allows you to specify n*2 double quotation marks (") is disabled (this is the default value).

1: If you are using quotation marks in a parameter string, the setting that allows you to specify n*2 double quotation marks (") is enabled.

To specify both 1 and 2 (see the SeparateStrCount and SeparateStr commands) as the value of this registry, type 3.

When the setting takes effect

The setting takes effect the next time the script file is executed.

Note

When a remote computer is specified in the CompName argument, operation is guaranteed only in a LAN environment. This command does not operate across firewalls.

Example
' Get a global variable on the local computer and write
' to the registry.
If GetGV ("Debug_Mode") = True Then
  Dbflag = "DebugFlag"
  RegWrite (HKEY_CURRENT_USER  _
         , "Software\Hitachi\Script\Option", Dbflag, True)
End
 
' Get and update the global variable on computer
' "SOP4A065(SCRIPT)".
If GetGV ("Debug_Mode","SOP4A065(SCRIPT)") = True Then
    SetGV ("Debug_Mode", False, "SOP4A065(SCRIPT)")
End
JP1/Script version

Supported from JP1/Script 01-00.