Email ListsRelated Things

DB/C DX Technical Summary

DB/C DX is a complete program development and execution runtime system.
The following is an overview of the features of DB/C DX.

DB/C DX Implements the Industry Standard PL/B Language
DB/C DX is in full compliance with the INCITS (formerly American National Standards
Institute - ANSI) Standard for the PL/B programming language. In addition, DB/C DX offers a wide range of enhancements to the PL/B Standard. All math and character string handling verbs are implemented. The maximum number of digits in FORM variables is 31. The maximum size of DIM variables is 65,500. One, two and three-dimensional arrays of FORM and DIM variables are supported. The maximum data area size and maximum program area size for a single compiled module are 8MB each.

All program control verbs are implemented including: ROLLOUT, EXECUTE,
CALL/RETURN, GOTO, IF/ENDIF, LOOP/REPEAT, BRANCH, and PERFORM. TRAP
is implemented and allows trapping of multiple characters and keys.

All KEYIN and DISPLAY features are implemented, including: subwindows, color, underlining, reverse video, blinking, bold, and more. All subwindow functions including scrolling are supported for all terminals. The ability to save and restore either the current subwindow or the entire screen is also supported for all terminals.

File I/O is fully supported by the sequential, random, indexed, and associative access methods. FILEPI, partial READ and WRITE, tabbing, minus over punch, and zero fill are supported. The maximum record size is 65,500. Full space and digit compression is available. All I/O is completely multi-user; FILEPI 1 is unnecessary. Printer support is fully implemented, including: SPLOPEN, SPLCLOSE, PFILE, and all print control codes in PRINT.

DB/C DX Runs on Most Industry Standard Operating Systems
DB/C DX runs on Windows XP through Win7 and many UNIX operating environments. See DB/C DX Supported Systems for a complete list.

Programs compiled under DB/C DX can be run on any supported operating system without recompilation.

DB/C DX Commands Provide All Essential Functions

DBCMP The DB/C language compiler
DBC The run-time facility
DBCC The character mode run-time facility
AIMDEX Associative access method file create command
BUILD Record selection command
CHAIN Automatic command execution facility
CREATE Data file create command
COPY File copy command
DELETE File delete command
DUMP File inspection and modification utility
EDIT Source file editor
ENCODE File converter command
EXIST File existence utility
FDE Fast Development Environment
FILECHK File diagnostic utility
INDEX Indexed access method file create command
LIBRARY Source and object library utility
LIST File list command
REFORMAT Record reformat command
RENAME File rename command
SORT Data file sort command
TDCMP Terminal definition file compiler

Highlights of DB/C DX

DB/C DX implements file I/O using two different methods. The traditional method is by accessing files using the local operating system—the DB/C DX data and index files may be on local disks or on network file servers.

The second method of accessing files is with DB/C FS. The connection between the DB/C DX runtime and the DB/C FS server is a TCP/IP connection. Thus the connection may be anywhere on an intranet or on the Internet. This method has several advantages, including better fault tolerance and much better performance over slower wide area networks.

GUI Programming
DB/C DX GUI programming is implemented in a manner that is different from many other GUI programming environments. All windows, dialogs, menus, controls and other elements of the graphical interface are defined in the DB/C language source program. This approach provides for much more understandable and maintainable programs because everything is contained in the program, not in separate resource files.

There are four new data types that used extensively in GUI programs. These data types are QUEUE, RESOURCE, DEVICE and IMAGE.

QUEUE variables provide for both stack and queue oriented message buffering and delivery. QUEUE variables are used to retrieve event messages (such as mouse movements, mouse clicks, and key strokes) that programs respond to.

RESOURCE and DEVICE variables are used to define various objects like windows, dialogs, menus, panels, icons, timers and the system clipboard.

IMAGE variables define a rectangular canvas that is painted with the DRAW statement. DRAW operations including drawing dots, lines, circles, text, and more. Other actions can be performed on IMAGE variables including loading an image from a TIFF, GIF or JPEG file, storing an image to a TIFF file, showing an image in a window, printing an image and more.

DB/C DX contains support for all of the standard GUI controls including text edit controls, pushbuttons, list boxes, drop boxes, check boxes, progress bars, tab groups and more. Creation of these controls is done with the PREPARE statement which allows for complete runtime creation of controls and their placement in dialogs and panels. This level of flexibility is not found in many other GUI programming environments.

Object-Oriented Programming
DB/C DX contains all of the features of an object-oriented programming Language, including classes, inheritance, polymorphism and dynamic binding.

Classes are implemented in a way that fits naturally into the DB/C language. Classes are implemented by the CLASS DEFINITION and ENDCLASS statements. Object variables are used to instantiate a class. DB/C is a dynamically linked language (there is no linker), so polymorphism and dynamic binding also fit well into DB/C.

TCP/IP Programming
DB/C DX contains a complete interface for sending and receiving messages using the industry standard TCP/IP communications protocol.

TCP/IP actually consists of two communications protocols: TCP and UDP. The TCP/IP protocols are used on the Internet and on many corporate LANs and WANs. The COMFILE type data variable and the SEND, RECV and COMTST statements are used to send and receive messages using TCP and UDP.

Support for the Domain Name Service (DNS) interface is also included in DB/C DX. DNS is used to translate an Internet address (such as dbcsoftware.com) to an actual IP address (such as 199.3.63.34).

Algebraic expressions
Expressions may exist anywhere that a literal is allowed. For example:

		MOVE ((X-32) * 1.8) TO Y
		IF ((A > B) & (C = D))
			DISPLAY "YES"
		ENDIF

User-defined verbs
DB/C DX allows a programmer to create a custom verb that may be used like any regular executable verb, except the user-defined verb is implemented by DB/C or C code provided by the programmer. This is a powerful technique for creating high-level generic routines.

For example, a programmer might create a user-defined verb called BOX. The syntax would include parameters for the size of the box and the position on the screen. Whenever the programmer wants to display a box on the screen, BOX can be used just like the built-in verbs.

Multiple module execution
The LOADMOD verb loads secondary .dbc modules. In addition, multiple instances of the data area of the same module can be loaded. CALLs and GOTOs can be directed to labels in secondary modules. CALLs with parameters allow access to variables in different modules. For example:

	. PROG1.TXT	
	CHAR10	DIM 10
	FUNC1	EXTERNAL
		MOVE "PARAMETER1" TO CHAR10
		LOADMOD "PROG2"
		CALL FUNC1 WITH CHAR10, "PARAMETER2"
		STOP

	. PROG2.TXT
	PARM1	DIM @
	PARM2	DIM @
	FUNC1	ROUTINE PARM1, PARM2
		DISPLAY *ES, PARM1, ", ", PARM2
		RETURN

Support for various text, binary, and native files
The TEXT file type, when specified in a FILE, IFILE, or AFILE declaration, means that the data file is compatible with source text files on the run-time operating system.

The BINARY file type, when specified in a FILE declaration, means that the data file is a binary file (i.e. there are no end-of-record characters).

The NATIVE file type, when specified on a FILE or IFILE declaration, means that the data file and associated indexes are of a type native to the run-time operating system. In UNIX, the NATIVE file type can be C-ISAM. In this way, NATIVE file support can provide access to file types used by other languages (e.g. COBOL).

The DATA file type, when specified in a FILE, IFILE or AFILE declaration, means that the datafile is an ASCII, line-feed delimited text file, regardless of operating system.

Support for SQL (Structured Query Language)
SQL verbs may be embedded in the DB/C lanuage source programs with the SQLEXEC verb. For example:

SQLEXEC "SELECT NAME INTO :1 FROM BOOKS WHERE ID=:2", BOOK, ID

Record locking
Record locking is optionally specified on the OPEN statement and with verbs such as READLK, READKSLK and UNLOCK.

INTEGER and FLOAT data types
For example:

	NUM6	INTEGER 6
	NUM7P2	FLOAT 7.2

are equivalent to regular FORM declarations except that all calculations will be done using 32-bit integers and 64-bit floating point variables, respectively. In all other respects (such as WRITE to a file or DISPLAY on the screen), INTEGER and FLOAT declarations are handled as if they were FORM declarations.

Additional variable types
Global variables persist across program chaining. In all other respects, global variables are identical to non-global variables. Globals variables can be statically declared or dynamically created with the MAKEGLOBAL verb. The MAKEVAR verb can be used to dynamically create variables. The RECORD and RECORDEND data definition verbs are used to define record templates. A record template can be referred to later for definition of different record variables that have the same constituent variables. The LABEL statement can be used to define a label variable. A label variable defines a program execution label that can be changed at run time.

Local variable definition support
A data variable can be defined anywhere in a program prior to its first use. Data variables may also be local to a routine. The ROUTINE or LROUTINE verbs define the start of a routine, and the ENDROUTINE verb defines the end of a routine. Routines may be nested and all variables are visible at any nesting level.

TRAPCLR ALL, TRAPSAVE, TRAPRESTORE, DISABLE, and ENABLE verbs
TRAPCLR ALL clears all traps. TRAPSAVE saves the current status of all traps in a character variable. TRAPRESTORE restores the status of all traps from a character variable set by TRAPSAVE. DISABLE causes all keystroke trap events to be deferred until an ENABLE statement executes, a KEYIN statement executes, or program chaining occurs.

FLAGSAVE, FLAGRESTORE and SETFLAG verbs
These verbs allow the programmer to save and restore all flags, or to set and clear selected flags.

Reuse of deleted record space
An option is available to reuse space in text files that has been deleted by indexed or AIM DELETE. This option is only available for files containing fixed length records. It is specified by adding -S=nnn to the INDEX or AIMDEX command line.

International support
Characters other than the standard 95 ASCII printable characters are optionally allowed in KEYIN, DISPLAY, READ, and WRITE. When specified for READ and WRITE, digit and space compression is disabled. In addition, a key map file, a case map file, and a collating file can be used to test and translate characters in KEYIN, AIM READ operations, and the SORT and INDEX utilities, respectively.

Industry standard function keys
These keys are supported by TRAP, GOTO, CALL, IF and WHILE: F1 through F20, UP, DOWN, LEFT, RIGHT, INSERT, DELETE, HOME, END, PGUP, PGDN, ESC, QUIT, BKSPC, TAB, BKTAB, and ENTER. In addition, the SETENDKEY and CLEARENDKEY verbs define specified keys as KEYIN ending keys. The GETENDKEY verb returns a number that identifies the key that terminated the last KEYIN statement. The edit KEYIN control code. The *EDIT control code causes LEFT, RIGHT, and DELETE to function as edit keys.

Completely portable graphical DISPLAY control codes
These control codes are:

	*LFA		left arrow
	*RFA		right arrow
	*UPA		up arrow
	*DNA		down arrow
	*HLN		horizontal line
	*VLN		vertical line
	*CRS		crossed lines
	*ULC		upper left corner
	*URC		upper right corner
	*LLC		lower left corner
	*LRC		lower right corner
	*RTK		right tick mark
	*DTK		down tick mark
	*LTK		left tick mark
	*UTK		up tick mark
	*DBLON		double line on
	*DBLOFF		double line off
	*HDBLON		horizontal double line on
	*HDBLOFF	horizontal double line off
	*VDBLON		vertical double line on
	*VDBLOFF	vertical double line off

These graphic control codes may be contained in KEYIN and DISPLAY lists. They may also be used as the operands for *RPTCHAR, *RPTDOWN and *ESCHAR. For example:

	DISPLAY *ES, *ULC, *RPTCHAR=*HLN:78, *URC;

Multiple print file support
The PFILE statement is used to direct printed output to multiple destinations. For example:

	PRT1	PFILE 
	PRT2	PFILE           
		SPLOPEN PRINT1, "file1.prt"
		SPLOPEN PRINT2, "file2.prt"
		PRINT PRINT1; "This line goes to file1"
		PRINT PRINT2; "This line goes to file2"
		SPLCLOSE PRINT1
		SPLCLOSE PRINT2

Automatic print spooling
The SPLCLOSE verb allows a print file to be spooled to the system print spooler. For example:

		SPLOPEN "PRTFILE.PRT", "D"
		PRINT "A PRINT LINE"
		SPLCLOSE "S,B,N=2,D"

The D parameter of SPLOPEN causes the print file to contain device control characters (CR, LF, FF) instead of ANSI carriage control characters. The S parameter of SPLCLOSE causes the file PRTFILE.PRT to be submitted to the system spooler. The B option causes a banner page to be printed. The N=2 option causes two copies to be printed. The D option causes PRTFILE.PRT to be deleted when printing is complete.

Other Features
The pushreturn statement allows a program label or label variable value to be pushed onto the return stack. The popreturn statement causes the label value at the top of the return stack to be copied to a label variable and removed from the return stack.

When used in conjunction with the with names operand of the record and list statements, the getname statement provides the programmer with the names of variables contained in the record or list at run-time. This is useful in conjunction with SQL.

The setnull statement causes numeric and character variables to be set to the NULL state. The isnull operator is used in expressions to test the NULL state of a numeric or character variable. The setnull statement and the isnull operator are particularly useful in conjunction with SQL.

A call statement with parameters may pass label variables by prefixing the variable name with the tilde (~) character. Similarly, the routine statement may receive the value of a program label into a label variable by prefixing the label variable name with the tilde character.

The initial operand may be specified on address variable definitions to allow the address of a previously defined variable to be stored in the address variable at compile time.

The *pl, *ll, and *sl control codes may be used in the send and change statements.

The unlock statement allows a single record to be unlocked in a file.

The move statement of a list variable to another list variable causes each of the variables contained in the source list variable to be moved to each of the variables in the destination list.

In the character mode versions of DB/C DX, PDF, PCL and PostScript printer output is supported with the L=PDF, L=PCL and L=PS operands of the splopen statement.

Single event and recurring timer support is available in conjunction with device and queue variables.

The CHAIN utility
Directives include: //IF, //ELSE, //XIF, //WHILE, //END, //DO, //UNTIL, //LABEL, //GOTO, //ABORT, //INCLUDE, //BEEP, //DISPLAY, //KEYIN, //ASSIGN //SET //OPEN, //READ, //WRITE, //REWRITE and //LOG. Algebraic expressions with arithmetic, logical, and string operators are supported. Variable replacement with # is supported.

The SORT utility
Options include: mixed ascending and descending keys, header or group record sort, alternate sort algorithm, key tag sort, stable sort, and more.

The BUILD and REFORMAT utilities
These utilities allow records to be selected, appended, merged, reformatted, compressed, and expanded.