Programming Language

4GL QLX, a programming language

"...don’t think how to do it, just think – what for..."

QLX is a high-level programming language. Its syntax has been simplified as much as possible in order to make it an optimal tool for the Gardens Builder application. As assumed, it should enable not only programmers but also specialist consultants to develop the application. The main advantage of the QLX language is the fact that it is a highly optimised and specialised tool for developing business software. QLX is simple, as it consists of basic syntax and extensions: the SYS library and methods used for managing DS objects.

 Developer Window Example

 QLX – Basic syntax


System :
o Boolean,  Integer, Decimal, Date, Text, BLOB, Rec, Object

Former custom types and their counterparts in system types ():
o Number (Decimal), Option(Integer), String (Text), Field(?), COM (Object)

:Type conversion

Conversion during the evaluation of operations on two variables is performed in the following sequence (starting from the lowest type):

Boolean, Integer, Decimal, Date, Text, Blob,  Rec Object

For two types, conversion is performed in an ascending order.

When writing, conversion is possible in all orders.

It can be assigned as an operation e.g.: l = ((p=5)-4); or l = p = i = 5;


FOR (iEx = minValue;maxValue ) { statement }
WHILE ( bEx ) { statement }

:conditional statement :

IF ( bEx ) { statement }
ELSE { statement}

:operators :

& - i bEx= bEx1 & bEx2

| - lub bEx= bEx1 | bEx2

<> - różny bEx= bEx1 <> bEx2 lub bEx = !(bEx1 = bEx2)

! - negacja bEx= ! bEx1

:return function value and break:

EXIT ( Value, [break] );

:obsługa wyjątków :

TRY { statement }

:commit data base transactions :

COMMIT ( [tConnection, bClose] )

QLX – Basic GUI enhancements

ERROR ( tInfo );

System :
Breaking a single code path and database transaction (if not included in the TRY statement, the message in GUI)

tInfo – Error Message

DIALOG ( tInfo ,[ iType ] ) : iModal

Information and dialog boxes

tInfo - Information

iType – Dialog Box Type

STATUS ( ['O','U','C'], tId, tInfo, iSize )

O – Open status windows or adds an additional status panel

U – Update the status

C – Close status windows

tid – Status ID

tInfo – Status label

iSize - Max. status bar

INFO ( tInfo , [clear ] )

Add a line in a "Info" descriptive window.

iInfo - message,

clear - if clear = 1, the content of the Info window is cleared before a new line is added.

RUNWIN ( tName , [iType, iReportType ] )

Run a window or report (display, print, export the window)

CREATE ( COMobject )

Create an object batch COM, COM+

QLX - Sample DS methods





_ASXML :Text

Generates XML with Ds.



DS name 



Returns the name of a first structure field if the structure is constructed dynamically. 


_FROMXML(Blob, [Bool recid])

Parsers XML to DS.


_GETDS(fname,Rec) : Bool

DS nod search.


_GETFIELD (fname):TextValue

Returns a field value based on a selected field name.


_GETTYPE(fname) :text

Returns a field type based on a field.


_MODIFYALL(fname, textvalue)

Modifies all values in the field for all selected records.



 Returns the name of a subsequent field if the DS structure is constructed dynamically.



Changes a data source. Data for the DS structure can be retrieved from multiple databases.



 Sets the field value based on a field name. 



Sets the second filter level.



Sorts structures in the system memory regardless of data base sorting.


_SUMFIELD(fname): decimal

 Returns the sum of values in a selected field.


_SUMFIELDS (SumDS,[fname 1,...,fname n]);

Creates tempds - sumds excluding selected fields; uses all decimal fields.



Clears all values in a selected record.


COPY(rec, noisnert)

Noinsert 1 – Copies only one level and does not enter 0 into the database; by default, it copies all structures from records to a similar structure with substructures, inserting records into a database.


COUNT(memonly bool)

Returns the number of records.



Creates a data structure in a selected database.


DELETE :bool

Deletes a selected record including its substructures.



Deletes all records including their substructures.


EXPORT(FileName,[CSV,XML,TAB], [header str])

 Exports data stored in the DS structure into a file. 


FIND( Fname,val ,[bConti]):bool

Searches a text in a field: CS bConti : 0, brak - od poczatku, 1 - od miejsca


FIRST : bool

Places the cursor in the first data record.



Returns existing filters set for DS data.


IMPORT(FileName,[CSV,XML,TAB], bool recid, [header str])

Imports data to a DS structure from a file.



Inserts a selected data record into a database.


LAST : bool

Inserts the cursor in a last data record.


LOOP ([memonly bool, reverse]) {}

Browses all records in a selected data set of a DS structure.



Inserts a checkmark in a selected record.  



Checks whether a selected record is marked.


NEXT : bool

Moves the DS cursor to a subsequent data record. 


ORDER( f1,f2,...)

Initiates sorting of data retrieved into a database. 


SETFILTERS( f1,f2...)

Sets a first-level filter on various fields.



Modifies data in a database.



Direct access to a DS field structure:nazwasubds:nazwapola... or "ds:nazwa pola"


Defining a DS method in a package linked to a DS

ds:nazwmetody(params) or "ds:nazwa metody"(params)

QLX – Sample methods for the SYS library





ASTIME (Date):Text

Returns a time value from Data and Time variables.


BLOB(op[I E C],

I – imports the Blob variable from a file, E – exports the Blob variable from a file, P – packs the Blob U – unpacks the Blob variable.



Returns a character from an Asci code.



Closes the I/O device.



Returns the cosine angle.


CREATEDS(dsname,temprec): Bool

Creates DS based on a DSTree in the garden.



Returns the cotangents angle. 


DATEDIFF (Date1,Date2):Int

Calculates the difference between date and time.


DATEINT (Date,Text[YMDWRhms]):Int

Converts Date and Time to number values. 


DATEMAKE (Date,Int,Text[YMDhms]):Date

Creates Date and Time.



Deletes a file from the hard drive.



Returns the last error stored in the TRY clause.



Opens the I/O device. 


OPENFILE(Mask) :FileName

Opens a dialog box where you can select a file to be opened.



A random function.



Reads all data from I/O device, e.g. from a TCP/IP port.


ROUND(Dec,Precision,[+,-]): Dec

Rounds numeral variables.



Runs server watch. When the client is connected, PacName:Run is run.


SAVEFILE(Mask) :FileName

Opens a window where you can select a file to be saved.


SHELL(FileName, Params, Operat)

Starts actions for files compliant with the system shell.



Returns the sinus angle.


SQL(command,[ Conn , dsresult])): Bool

Runs an SQL command in a selected database. 


STRCOPY (Text,Pos,[Len]):Text

Copies a substring from a text variable.


STRLEN (Text):Int

Returns the length of a text variable.



Returns the date and system time.



Returns the tangent angle. 


USERLOGIN ([UserId],[Password]):UserId

Returns the ID of a logged system user.



Enables you to save a text into a I/O device e.g. a TCP/IP port.  

QLX – GUI object methods (windows, reports, GDI)






Property setup.



Adds a subitem.



Deletes a subitem Id = ?ALL? .


SETITEM(id, name,val)

Sets the property of a subitem.






Returns handle to a window.



Sets a focus in an object.






Draws a rectangle.



Draws lines.



Clears a buffer bitmap.


SETCOLOR (Col, Typ, Wi)

Sets a line colour and width.



Draws an ellipsis.



Adds an action to a pop-up menu in the GDI.



Draws objects in a BMP and EMF format.



Draws a text. 



Colours an area. 



Draws a multi-gradient structure.


SAVEAS(FileName, [W,H])

Saves a picture in an EMF format.






Opens a window (report) that is modal for Win: Based on a DS entered as a reference.



Processes window events.


DIALOG( text,ds.,typ,f1?fn) :int

Creates a modal dialog box with edit or grid features Typ 0 ? edits1 ? read grid 2 ? edit grid 3 - tree 4 - ListView f1?fn nazwy pól.



Action = mok,mcancel





PRINTSEC (SecName,bool nomove)

Prints a selected report section. 



Moves the cursor to the next printout page.


PAGENO : int

Returns the number of a selected page.