SheerPower® 4GL
A Guide to the SheerPower Language


Previous Contents Index

PURPOSE:

ASK SEED sets or resets the pseudo-random number sequence.

DESCRIPTION:

ASK SEED returns the current starting point of a pseudo-random sequence and stores the number in num_var.

SET SEED sets the starting point of a pseudo-random sequence with the number in num_expr.

11.14 ASK | SET SYSTEM

There are a number of ASK SYSTEM and SET SYSTEM statements. These are described in the following sections. The ASK/SET statements ask about and set various system operation features.

11.14.1 ASK SYSTEM: COMMENT

FORMAT:


        ASK SYSTEM: COMMENT str_var 

EXAMPLE:

Example 11-19 ASK SYSTEM: COMMENT statement

  set system: comment 'Invoice Entry' 
  ask system: comment c$ 
  print c$ 
  end
 
 
Invoice Entry 

DESCRIPTION:

The ASK SYSTEM: COMMENT statement asks for the SheerPower operating system comment for the process.

11.14.2 SET SYSTEM: COMMENT

FORMAT:


        SET SYSTEM: COMMENT str_expr 

EXAMPLE:

Example 11-20 SET SYSTEM: COMMENT statement

  set system: comment 'Invoice Entry' 
  ask system: comment c$ 
  print c$ 
  end
 
 
Invoice Entry 

11.14.3 ASK SYSTEM: DIRECTORY

FORMAT:


        ASK SYSTEM: DIRECTORY str_var 

EXAMPLE:

Example 11-21 ASK SYSTEM: DIRECTORY statement

  ask system: directory z$ 
  print 'Current directory is: '; z$ 
  end
 
 
 Current directory is: c:/sheerpower 

DESCRIPTION:

ASK SYSTEM: DIRECTORY asks the operating system for the current default device and directory.

11.14.4 SET SYSTEM: DIRECTORY

FORMAT:


        SET SYSTEM: DIRECTORY str_var 

Important note on the following example:

The following example assumes that you have a folder named "examples" inside of your SheerPower folder [c:\SheerPower\examples].

EXAMPLE:

Example 11-22 ASK SYSTEM: DIRECTORY statement

  ask system: directory z0$ 
  print 'Current directory     '; z0$ 
  set system: directory 'c:\sheerpower\examples' 
  ask system: directory z1$ 
  print 'Directory set to      '; z1$ 
  delay 2 
  set system: directory z0$ 
  print 'Directory set back to '; z0$ 
  end
 
 
Current directory      c:\sheerpower 
Directory set to       c:\sheerpower\examples 
Directory set back to  c:\sheerpower          

DESCRIPTION:

SET SYSTEM: DIRECTORY sets the default device and directory.

11.14.5 ASK SYSTEM, LOGICAL: VALUE

FORMAT:


        ASK SYSTEM, LOGICAL str_expr: VALUE str_var 

EXAMPLE:

Example 11-23 ASK SYSTEM, LOGICAL: VALUE statement

  ask system, logical "SheerPower": value scr$ 
  print '"SheerPower" points to: '; scr$ 
  end
 
 
"SheerPower" points to: c:\SHEERPOWER\

DESCRIPTION:

ASK SYSTEM, LOGICAL asks the operating system to translate the logical name in str_expr and place the result into the variable specified by str_var.

11.14.6 SET SYSTEM, LOGICAL: VALUE

FORMAT:


        SET SYSTEM, LOGICAL str_expr1: VALUE str_expr2 

EXAMPLE:

Example 11-24 SET SYSTEM, LOGICAL: VALUE statement

  set system, logical 'SheerPower': value 'c:\sheerpower\examples\tester' 
  ask system, logical 'SheerPower': value z$ 
  print 'Logical set to '; z$ 
  end
 
 
Logical set to c:\sheerpower\examples\tester 

DESCRIPTION:

SET SYSTEM, LOGICAL: VALUE statement sets the operating system logical name in str_expr1 to the value in str_expr2.

You can also set logical values by editing the SP4GL.INI file, creating a [logicals] section, then defining the logical. For example:

Example 11-25 Set Logicals in SP4GL.INI

  [logicals] 
  mylogical=c:\somewhere 

11.14.7 ASK SYSTEM: MODE

FORMAT:


        ASK SYSTEM: MODE str_var 

EXAMPLE:

Example 11-26 ASK SYSTEM: MODE statement

  ask system: mode process_mode$ 
  print 'Process Mode: '; process_mode$ 
  end 
 
 
Process mode: BATCH 

DESCRIPTION:

ASK SYSTEM: MODE statement returns the mode of the process which is one of the following:

INTERACTIVE
BATCH
NETWORK
OTHER

11.14.8 ASK SYSTEM: PARAMETER

FORMAT:


        ASK SYSTEM: PARAMETER str_var 

Note

ASK SYSTEM: PARAMETER works only in Windows 2000 and Windows NT.

EXAMPLE:

Example 11-27 ASK SYSTEM: PARAMETER statement

  ask system: parameter param$ 
  print 'Parameter was: '; param$ 
  delay
  end
 
 
 
c:\sheerpower> test.spsrc hello  <---- type in 'test.spsrc hello' at the Command (DOS) 
                                       prompt to run this program. 
                                       
Parameter was: hello             <---- this will appear in the console window                                       

PURPOSE:

ASK SYSTEM: PARAMETER returns any parameter from the command line given after the program name and places it in str_var.

DESCRIPTION:

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.

11.14.9 ASK SYSTEM: PROCESS

FORMAT:


        ASK SYSTEM: PROCESS str_var 

EXAMPLE:

Example 11-28 ASK SYSTEM: PROCESS statement

  ask system: process process$ 
  print 'Process is: '; process$ 
  end
 
 
Process is: SheerPower 4GL 

DESCRIPTION:

ASK SYSTEM: PROCESS str_var asks the operating system for the current process name.

11.14.10 SET SYSTEM: PROCESS

FORMAT:


        SET SYSTEM: PROCESS str_expr 

EXAMPLE:

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 

DESCRIPTION:

SET SYSTEM: PROCESS str_expr changes the operating system process name to str_expr.

11.14.11 ASK SYSTEM: PROGRAM

FORMAT:


        ASK SYSTEM: PROGRAM str_var 


Previous Next Contents Index