Previous | Contents | Index |
ASK SYSTEM: PARAMETER returns any parameter from the command line given after the program name and places it in str_var. You can pass up to 8 parameters.
ASK SYSTEM: PARAMETER lets you obtain the command line that invoked SheerPower. The statement gives you the part of the command line after the program name.
ASK SYSTEM: PID str_var |
Example 11-31 ASK SYSTEM: PID Statement |
---|
ask system: pid current_pid$ print 'Current Process ID is: '; current_pid$ end Current Process ID is: 8936 |
ASK SYSTEM: PID returns into str_var the PROCESS ID of the current process.
The process id, PID, is often written to log files or audit tables when tracking information about a given Sheerpower process.
ASK SYSTEM: PROCESS str_var |
Example 11-32 ASK SYSTEM: PROCESS Statement |
---|
ask system: process process$ print 'Process is: '; process$ end Process is: Sheerpower 4GL |
ASK SYSTEM: PROCESS str_var asks the operating system for the current process name.
SET SYSTEM: PROCESS str_expr |
Example 11-33 SET SYSTEM: PROCESS Statement |
---|
ask system: process process$ curr_process$ = process$ print 'Current process is: '; curr_process$ new_process$ = 'do_test' set system: process new_process$ ask system: process process$ print 'New process is: '; process$ set system: process curr_process$ ask system: process process$ print 'Old process restored: '; process$ end Current process is: Sheerpower 4GL New process is: DO_TEST Old process restored: Sheerpower 4GL |
SET SYSTEM: PROCESS str_expr changes the operating system process name to str_expr.
ASK SYSTEM: PROGRAM str_var |
Example 11-34 ASK SYSTEM: PROGRAM Statement |
---|
// make a sample program file called // mysample.spsrc in \sheerpower\samples\ // and paste in the following code: ask system: program x$ print 'This program is '; x$ end This program is c:\sheerpower\samples\mysample.spsrc |
The ASK SYSTEM: PROGRAM statement returns the full file specification of the running program. This is helpful for programs that check their own revision dates and for .SPRUN files that want to scan for compiled-in licenses using the %compile directive (see Section 3.9, Program and Compile Directives).
ASK SYSTEM: RIGHTS str_var |
Win9x does not provide any specific rights for users. ASK SYSTEM: RIGHTS will work only with Windows 2000 and Windows NT. |
Example 11-35 ASK SYSTEM: RIGHTS statement |
---|
ask system: rights process_rights$ print 'Your process rights are: '; process_rights$ end Your process rights are: SeLockMemoryPrivilege,SeIncreaseQuotaPrivilege,SeSecuri tyPrivilege,SeTakeOwnershipPrivilege,SeLoadDriverPrivilege,SeSystemProfilePrivil ege,SeSystemtimePrivilege,SeProfileSingleProcessPrivilege,SeIncreaseBasePriority Privilege,SeCreatePagefilePrivilege,SeBackupPrivilege,SeRestorePrivilege,SeShutd ownPrivilege,SeDebugPrivilege,SeSystemEnvironmentPrivilege,SeChangeNotifyPrivile ge,SeRemoteShutdownPrivilege,SeUndockPrivilege,SeManageVolumePrivilege,SeImperso natePrivilege,SeCreateGlobalPrivilege,SeIncreaseWorkingSetPrivilege,SeTimeZonePr ivilege,SeCreateSymbolicLinkPrivilege |
ASK SYSTEM: RIGHTS asks the operating system to return a comma-separated list of the rights explicitly granted to the calling process.
ASK SYSTEM, SYMBOL str_expr: VALUE str_var |
Example 11-36 ASK SYSTEM, SYMBOL: VALUE statement |
---|
set system, symbol 'Sheerpower': value 'Sheerpower Rapid Development Environment' ask system, symbol 'Sheerpower': value symbol$ print 'Value of symbol Sheerpower is: '; symbol$ end Value of symbol Sheerpower is: Sheerpower Rapid Development Environment |
ASK SYSTEM, SYMBOL: VALUE statement asks the operating system to translate the symbol name in str_expr and place the result into the variable specified by str_var.
ASK SYSTEM, SYMBOL 'DNS:x.x.x.x': VALUE str_var (where 'x.x.x.x' is a domain name or IP address to lookup) |
Example 11-37 DNS Lookups Using ASK SYSTEM, SYMBOL |
---|
ask system, symbol 'dns:cnn.com': value x$ print x$ 151.101.129.67 |
Example 11-38 DNS Lookup that does not exist |
---|
ask system, symbol 'dns:mymail.ttinet.com': value x$ print x$ // it returns a blank since mymail.ttinet.com does not exist |
ASK SYSTEM, SYMBOL 'DNS:x.x.x.x': VALUE a$ returns into a$ the IP address associated with x.x.x.x. If the DNS lookup fails, a$ will be a null string.
SET SYSTEM, SYMBOL str_expr1: VALUE str_expr2 |
Example 11-39 SET SYSTEM, SYMBOL: VALUE Statement |
---|
set system, symbol 'mysym': value 'hello' ask system, symbol 'mysym': value z$ print 'Symbol set to '; z$ end Symbol set to hello |
The SET SYSTEM, SYMBOL: VALUE statement sets the operating system symbol name in str_expr1 to the value in str_expr2.
ASK SYSTEM, SYMBOL 'DNS:x.x.x.x': value str$ //returns into str$ the DNS translation of 'x.x.x.x' |
Example 11-40 ASK SYSTEM, SYMBOL 'DNS:x.x.x.x': VALUE Statement |
---|
ask system,symbol 'dns:0.0.0.0': value x$ print 'Your computer name is: '; x$ end Your computer name is: TTI-DEV* |
Example 11-41 ASK SYSTEM, SYMBOL 'DNS:x.x.x.x': VALUE Statement |
---|
ask system,symbol 'dns:www.cnn.com': value x$ print 'The IP address is: '; x$ end The IP address is: 157.166.238.48 |
The DNS: prefix to a symbol returns the DNS translation value of "x.x.x.x". The value of "x.x.x.x" can be an IP address or a URL. It is useful in checking a server's internet connection or a website's availability.
ASK SYSTEM, SYMBOL 'OS:xxx': value str$ //returns into str$ the Operating system symbol value of 'xxx' |
Previous | Next | Contents | Index |