DataBasic Reference > Programming in DataBasic > Running a DataBasic Program in a Proc

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

Running a DataBasic Program in a Proc (DataBasic) (m618705+run_in_proc.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

Running a DataBasic Program in a Proc

A DataBasic program can be used in a Proc.

Example

The following DataBasic program is called LISTIDS:

   OPEN 'BASIC/TEST' ELSE
     PRINT 'FILE MISSING'; STOP
   END
10 N = 0
20 READNEXT ID ELSE STOP
   PRINT ID 'L##################':
   N=N+1
   IF N >= 4 THEN PRINT; GOTO 10
   GOTO 20
   END

The following Proc, called LISTBT, contains the command to execute the program LISTIDS:

PQN
HSSELECT BASIC/TEST
STON
HRUN BASIC/TEST LISTIDS<
P

To execute this Proc (and the DataBasic program contained within it), simply type in the name of the Proc at the TCL prompt (assuming that LISTBT is contained in the account MD). For example:

:LISTBT

LISTBT sort selects the item-ids contained in the file BASIC/TEST and invokes the DataBasic program LISTIDS, which then lists the selected item-ids, four per line.

RealityV15.1 (MoTW) Revision 7Comment on this topic