| Previous | Contents | Index |
ASK SYSTEM: PARAMETER returns any parameter from the command line given after the program name and places it in str_var.
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: PROCESS str_var
|
| Example 11-28 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-29 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-30 ASK SYSTEM: PROGRAM Statement |
|---|
// make a sample program file called // mysample.spsrc in the SheerPower Samples folder // 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.
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-31 ASK SYSTEM: RIGHTS statement |
|---|
ask system: rights process_rights$ print 'Your process rights are: '; process_rights$ end Your process rights are: FAST_ACCESS,TEST_ACCESS |
ASK SYSTEM: RIGHTS asks the operating system to return a list of the rights explicitly granted to the calling process.
ASK SYSTEM, SYMBOL str_expr: VALUE str_var
|
| Example 11-32 ASK SYSTEM, SYMBOL: VALUE statement |
|---|
set system, symbol 'SheerPower': value 'SheerPower 4GL' ask system, symbol 'SheerPower': value symbol$ print 'Value of symbol SheerPower is: '; symbol$ end Value of symbol SheerPower is: SheerPower 4GL |
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:xxx': VALUE str_var (where 'xxxx' is a domain name or IP address to lookup) |
| Example 11-33 DNS Lookups using ASK SYSTEM, SYMBOL |
|---|
ask system, symbol 'dns:mail.ttinet.com': value x$ print x$ 38.112.130.3 |
| Example 11-34 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:xxx': VALUE a$ returns into a$ the IP address associated with xxx. If the DNS lookup fails, a$ will be a null string.
SET SYSTEM, SYMBOL str_expr1: VALUE str_expr2
|
| Example 11-35 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 |
SET SYSTEM, SYMBOL: VALUE statement sets the operating system symbol name in str_expr1 to the value in str_expr2.
ASK SYSTEM: USER str_var
|
| Example 11-36 ASK SYSTEM: USER statement |
|---|
ask system : user uname$ print 'User is: '; uname$ end User is: Default |
ASK SYSTEM: USER statement returns the operating system name or ID for the user.
There are various ASK WINDOW and SET WINDOW statements. These are described in the following sections. The ASK/SET WINDOW statements ask about and reset different screen features.
ASK WINDOW AREA row, col, row, col: DATA str_var
|
| Example 11-37 ASK WINDOW AREA statement |
|---|
print at 10, 4: 'Mary had a';
print at 11, 4: 'little lamb';
ask window area 10, 4, 11, 15: data x$
print
print x$
end
Mary had a
little lamb
Mary had a
little lamb
|
ASK WINDOW AREA statement reads the text displayed on the screen within the area defined by the given upperleft/lowerright coordinates into a string variable, str_var. The coordinates are specified by upper-left row, upper-left column, lower-right row, lower-right column. The statement returns a <LF> delimited string. No screen attributes are stored.
SET WINDOW AREA row, col, row, col: DATA str_expr
|
| Example 11-38 SET WINDOW AREA statement |
|---|
x$ = 'Mary had a' + chr$(10) + 'little lamb'
set window area 6, 5, 7, 15: data x$
end
Mary had a
little lamb
|
SET WINDOW AREA statement sets the screen within the area defined by the given upperleft/lowerright coordinates to the specified string. This is the mirror image of ASK WINDOW AREA row, col, row, col: DATA str_var.
ASK WINDOW: COLUMN num_var
|
| Previous | Next | Contents | Index |