.
contact contact

New Keywords (A.03.xx)

 
.
  This document contains keywords either never documented on HP260 or are unique to Eloquence.

Please note that this document is rather old and this information has been included in the Eloquence documentation.

Keywords covered:

  • LOAD FORM, STORE FORM, IFLEN, OFLEN
  • CATOPEN, CATCLOSE, CATGETMSG
  • REFRESH ON, REFRESH OFF
  • SLEEP
  • POPUP BOX
  • XLENTER
  • DINTEGER, NUMERIC
  • XTRACE
  • SHOWTASK
  • XASSIGN, XPURGE
  • QUIT, QQUIT
  • MEMSPEC$, LDSPEC$, PNTR
  • BACKGROUND, NO OPERATOR, MAPVOL$, GETENV$ REVISION$, PID, PPID
  • CRTCOLS, CRTLINES
  • MAPPNTR$
  • ERRMSG$
  • KBCODE
  • XOWNID
  • RANDOMIZE, HOP


LOAD FORM

LOAD FORM "file",A(*)

Read FORM file into screen buffer and field order area into given array. Array must be of type INTEGER or DINTEGER and must have at least 7 + 2*number_of_input_fields + number_of_output_fields elements. The array elements are filled from forms file section 1.

Errors

56 File or directory not found or no read permission
861 Improper number of elements
862 Improper array type


STORE FORM

STORE FORM "file",A(*)

build forms file from screen buffer and order area from given array. Array must be of type INTEGER or DINTEGER and must have at least 7 + 2*number_of_input_fields + number_of_output_fields elements. At least the number of array elements are written into section 1. so you should REDIM array to required size.

Errors

56 File or directory not found or no read permission
861 Improper number of elements
862 Improper array type
863 Inconstent information given


IFLEN, OFLEN

IFLEN
OFLEN

Both will return the remaining length of desired field type, starting at current cursor position.


Message Catalog

CATOPEN fname
CATCLOSE
CATGETMSG [Msg_set,] Msg_num;String_var$

Applicaton message catalog support. This will allow eloquence applications to use HP-UX message catalogs (build by gencat).

Sample application code:

   DIM Msg$[80]
   CATOPEN "APP.CAT,TEST"
   Msg_set = 1
   Msg_num = 10
   CATGETMSG Msg_set,Msg_num;Msg$
   LDISP "Message = ";Msg$
   CATCLOSE
Msg_set may be omitted in GETGETMSG and will default to 1. If a CATGETMSG will be executed with no previous CATOPEN an ERROR 51 (file not open) will be returned.

If a message could not be located the result variable will contain an empty string.

A Message catalog remains open across programs (like COM) and will be reset if program execution stops (e.g. END).


Screen refresh

REFRESH ON
REFRESH OFF

Screen refreshment is done in two steps. First the internal screen buffer will be maintained. Then terminal image will be updated from internal screen buffer.

REFRESH OFF will suppress updating of terminal image. So it's possible to save some i/o time and prevent terminal from flicker.

REFRESH ON will update terminal image from internal screen buffer and re-establish automatic updating of terminal image. REFRESH ON is executed implied every time Eloquence waits for a user interaction (INPUT, LINPUT, WAIT, PAUSE ...).


SLEEP

SLEEP [delay]

SLEEP behaves like WAIT statement unless executing in BACKGROUND. BACKGROUND is defined as redirecting stdout or setting -b flag on commandline. If executing in BACKGROUND the WAIT statement behaves different:

  • timed delays are ignored
  • unconditional WAIT results in reading the next key from stdin.

This behaviour is acceptable for most programs. But if a program is dealing with external devices (e.g. modems or BDE) this may make it impossible to execute such programs in BACKGROUND.

Sample code:

   ON KEY#8:"EXIT" GOTO E
   REQUEST #11
   PRINTER IS 11
   ON INPUT #11 GOSUB P
   WAIT
E: STOP

P: A$=AREAD$(11)
   ...
   PRINT ">"
   WAIT 500
   PRINT "<"
   RETURN
This program works fine and may be used to get data from PORT #11 until KEY#8 is pressed.
Now we are in BACKGROUND - what will happen:
  • WAIT statement will read next line from stdin. If there is no more line on stdin the program will be terminated at once.
  • The only valid input is ":KEY #8" which will terminate program.
  • The timed DELAY in subprogram will be ignored.
  • The program wont work.

The solution for above problem is the SLEEP statement. If you replace the WAIT statement with a SLEEP statement this program will behave in background same like in foreground.

Beware: Don't exchange WAIT with SLEEP statement w/o further investigations: SLEEP won't read stdin, so it's impossible to trigger a key "press" via stdin.


POPUP BOX

POPUP BOX [xpos,ypos,] Image_def [,Return]

This will draw a nice box on your screen and wait for user response.

   POPUP BOX "[MESSAGE][Text line #1|Text line #2][YES|NO ]"

   ----------------
   |   MESSAGE    |     <- header
   |              |
   | Text line #1 |     <- text
   | Text line #2 |
   |              |
   | [YES] [NO ]  |     <- "buttons"
   ----------------
This box consists of 3 parts:
  • header : output in reverse
  • text : upto 20 text lines seperated by "|" character
  • buttons: upto 5 buttons seperated by "|" character

Header and text is optional and might be empty.

xpos and ypos are optional. If the are omitted, the box is centered on the screen. If xpos or ypos is <= 0 then this value will be ignored and default will be used.

You have to specify at least one "button". User could select a "button" in several ways:

  • Pressing RETURN will select the "default" button (reverse one). Pressing backspace, space or using the cursor keys you could move the default button.
  • Pressing the 1st character from button text (in this example either 'y' or 'n').

If you specify the variable it's possible to preset the default button (0 = 1st, 1 = 1st, 2 = 2nd ...). Users choice will be returned in this variable.

You will get ERROR 870 .. 875 if you specify an invalid box position or an invalid box "image".

NOTE: Screen buffer will be saved and restored. Program execution will be suspended until user selected a "button".

NOTE: In BACKGROUND the default button will be selected.


XLENTER

XLENTER String_var$

Extended LENTER. Up to 512 characters and protected lines may be ENTERed.

Sample hardcopy routine using XLENTER:

SUB Hardcopy
   DIM A$[512]          ! Line buffer
   X=XPOS               ! Save current x/y position
   Y=YPOS
   PRINTER IS 0         ! Open printer
   FOR I=1 TO 21
      CURSOR(1,I)       ! Read and print screen line
      XLENTER A$
      PRINT A$
   NEXT I
   PRINTER IS 8         ! Close printer
   CURSOR (X,Y)         ! Restore cursor position
SUBEND
This routine will work with form and protected lines too.


New data types

DINTEGER Val [ (dim) ]
Declare double integer variable. See also: INTEGER

NUMERIC
NUMERIC is used in parameter passing to subroutines and functions. NUMERIC will passby type checking for parameters and will match any numeric data type.

Example program:

REAL R
INTEGER I

CALL Val(A$,R)
CALL Val(A$,I)

SUB Val(A$, NUMERIC V)
   ON ERROR GOTO E
   V=VAL(A$)
   SUBEXIT
E: V=0
SUBEND


XTRACE

XTRACE [lvl]

Set internal trace level. This is similar to setting the commandline -t flag. Output will be stderr.

XTRACE or XTRACE -1 will disable internal tracing. XTRACE 2 will have the same effect as specifiing -t2 on command line


SHOWTASK

SHOWTASK

Output informations about Eloquence tasks to SYSTEM PRINTER.

SHOWTASK
TASK OWNER STAT UID   NAME      PID
---- ----- ---- ----- --------- -----
  12     0  0 Y   102 mike      27624
  15    12  0 N   102 mike      27625
  16    12  0 N   102 mike      27626
TASK Task number
OWNER Owner if secondary task or 0
STAT TSTAT of taskid and attached flag (Y=attached to terminal)
UID HP-UX user id
NAME HP-UX user name
PID eloqcore process id


XASSIGN

XASSIGN #fno TO fname;type [,assign_options ... ]

ASSIGN file of given type.

It's not possible to ASSIGN a file which has no extension of DATA. Now it's possible with the XASSIGN statement.

type could be any HP260 file type (e.g. DATA, PROG, FORM ...). If type is OTHR then NO extension will be added to filename.

XASSIGN #1 TO "/etc/passwd";OTHR
will assign #1 to /etc/passwd.


XPURGE

XPURGE fname [;type]

PURGE file of given type

If you want to remove a file which is not of type DATA you have to enter a statement like this:

   COMMAND "!rm "&MAPVOL$("CODE")&"WILLI.PROG"
with XPURGE you would enter simply:
   XPURGE "WILLI,CODE";PROG
If type is omitted, it defaults to DATA. So PURGE "WF1" and XPURGE "WF1" are equivalent.

If type is OTHR then NO extension will be added to filename.

e.g. XPURGE "WILLI";OTHR
will purge the file WILLI.


QUIT

QUIT
Terminate Eloquence, warning if program modified but not saved yet.

QQUIT
Terminate Eloquence, don't concern about unsaved program.

      ----------------------------
      |         WARNING          |
      |                          |
      | Program changed !        |
      | You are about leaving    |
      | HP ELOQUENCE w/o saving  |
      | your actual program.     |
      |                          |
      | Select QUIT to terminate |
      | HP ELOQUENCE.            |
      |                          |
      |     [QUIT] [CANCEL]      |
      ----------------------------


Eloquence environment

MMSPEC$
'device' specification of MSI device e.g. 'C2,4,0'

LDSPEC$
'device' specification of current program LOAD device e.g. 'C2,4,0'

PNTR
current 'PRINTER IS'

Will return current printer number or
-3 if PRINTER IS "SPOOLFILE"
-6 if PRINTER IS STDOUT
-7 if PRINTER IS STDERR
-8 if PRINTER IS TTY
-9 if PRINTER IS CONSOLE


HP-UX environment

BACKGROUND
returns 1 if executing in background (stdout redirected or -b switch on commandline). Implies NO OPERATOR.

NO OPERATOR
returns 1 if executing in bach mode (stdin redirected).

MAPVOL$(Volspec$)
returns hp-ux path of mapped volume name or device specifier

GETENV$(Env_name$)
returns value of environment variable

REVISION$
returns eloquence revision

PID, PPID
returns process/parent process id


CRTCOLS, CRTLINES

CRTCOLS
CRTLINES

Returns terminal geometry.

With HP-UX you are no longer limited to terminals with 80*24 dimension (e.g. XWINDOWS or you switch your 700/92 to 132 COLUMNS). Eloquence will use this additional space on screen. To let the application take advantage of this, the screen dimensions may be retrieved by this functions.

CRTCOLS returns the number of COLUMNS (usual 80) and CRTLINES returns the number of LINES (usual 24). This is a more portable way than coding constants like "24" or "80" in programs or checking environment variables.


MAPPNTR

MAPPNTR$(printer)

Returns printer mapping.
This makes sense if you use TIO and you want to configure the device using stty because PORT number may be configured to any devicefile.

Return values:
NONEXISTENT printer is not available
INTERNAL printer is 9 or 10 (and local printer available)
PIPE printer is mapped to a pipe
/dev/... printer is mapped to a (device-)file

It may also be used to check for existing printers.

Example program sequence:

   COMMAND "!stty 2400 icanon <"&MAPPNTR$(15)
This will configure device mapped to PRINTER/PORT 15 to use icanon mode at 2400 baud.


ERRMSG$

ERRMSG$(Error number)

returns error description of given error number The error message are located in the message catalog file eloq.cat which will be located at the standard NLS path.

For example:

   DISP ERRMSG$(2)
   "Memory overflow"
Error handling:

ERRMSG$ wont raise program error if either message or message catalog could not be found to avoid looping in the error handler.

Instead it will return an error message which will contain the error number and an descriptive text where '#' will replaced by the error number parameter:

   (ERR#): Message catalog not found
   (ERR#): Error message not found


KBCODE

KBCODE

Waits for a key and returns internal code of key.

This internal code is simply the ROMAN8 code ('A' = 65) for all non function keys. All Function keys return codes of 256 + id (e.g. F1 = 265, F2 = 266 ... as defined by curses).

In this example program you could use normal keys like softkeys:

   DISP "Select option (1 .. 3 or E)"
   LOOP
      K = KBCODE
      EXIT IF CHR$(K)="E"
      SELECT CHR$(K)
      CASE "1","2","3":
         DISP "-> option ";K-NUM("0")
      CASE ELSE
         BEEP
      END SELECT
   END LOOP
   END
This is a more complex example. It could be used as a replacement of the ACCEPT statement. It will maintain an edit string of given length. For each character you enter a '*' is output. You could correct yout input with the BACKSPACE key. Input will be finished if you either press RETURN key or if you entered Max_len characters:
     DEF FNAccept$(Max_len)
        DIM A$[Max_len]
        LOOP
           C=KBCODE
           SELECT C
           CASE 13                             ! CR
              EXIT IF 1
           CASE 0 TO 7,9 TO 12,14 TO 31,>127   ! CONTROL
              BEEP
           CASE 8                              ! BACKSPACE
              IF LEN(A$) THEN
                 A$=A$[1,LEN(A$)-1]
                 DISP "~ ~";                   ! "BS SPACE BS"
              ELSE
                 BEEP
              END IF
           CASE ELSE                           ! CHARACTER
              A$=A$&CHR$(C)
              DISP "*";
              IF LEN(A$)=Max_len THEN
                 BEEP
                 EXIT IF 1
              END IF
           END SELECT
        END LOOP
        RETURN A$
     FNEND


XOWNID

XOWNID

Returns owner of given task id

For example:

  XOWNID(15) 
will return owner of TASK 15 or zero if either orimary task or not REQUESTed.


RANDOMIZE

RANDOMIZE start_value

This will reset the (pseudo-) random number generator to a new starting value.
If the start value is omitted, random number generator starting value is derived from actual system time.
If the optinal start value is given, it will first be converted to an integer value and then the lower 48 bits of it will be used to initialize random number generation.


HOP

HOP line spec

HOP will resume execution until reaching either the next line if is not specified or the line optional specified. Execution will stop before executing line.

This is a advantage in debugging process, because functions, subprograms and loops may be executed and execution stops after processing.

HOP is only available in eloquence DVP product.

Example:

   10 FOR I=1 TO 10
   20   X=X+I
   30 NEXT I
   40 DISP X
   50 END
HOP 30 will resume execution until reaching line 30. Line 30 will be displayed. Entering HOP will continue execution until line 40 is to be executed.


 
 
.
 
 
  Privacy | Webmaster | Terms of use | Impressum Revision:  1998-09-24  
  Copyright © 1995-2002 Marxmeier Software AG