DEVELOPER

QUICKSTART

INTRODUCTION

WHAT IS FOR
	WHAT IS FOR

	The development system is geared especially to hand data organized in tables. You could say that is a management-oriented development. Since the display settings and layout of documents are very versatile, you can design any type of application, from a simple schedule to an accounting or billing system.
BASE AND CONCEPT
	BASE AND CONCEPT

	In a very single way, one could say that any application we develop will be based on data and views derived from them.
	The data will be mostly data organized in tables, but we also have unorganized data, associated to variables, temporary or permanent. A simple example of data organized can be a description of an item, which will be organized in a table of items and has a position on the application, identical to the description of another article. An example of an unorganized data may be the VAT rate by default. We may have this value associated with a variable load at the beginning of the application for later use.
	The views are basically the screens and documents. Consider screens, those presentations capable of interacting with the user, typically by capturing data from a keyboard or a scanner. A document is instead a non-interactive data view.
	The link between all of this is the configuration or programming. This is the component that will enable us to shape the application off at the above concepts.
	This is what makes AppDesigner, the application to put these concepts into something useful. For this we have the following utilities:

 - File structure to define the files or tables that use the application.
 - Design of screens, to define the interactive views of the application.
 - Design document to define the non interactive views.
 - Scripts edition, for thatwe can not do with the above utilities.

SINTAXIS Y FUNCIONES
                                 Expressions and Functions
                                 =========================
 
 ALPHA                         identify by $. Sample: a$, var$, $value, b$='hello'
 NUMERIC                       identify by #. Sample: a#, num#, x#=25.37+14.56
 SMALL                         Sample: a, b, integer=25 (range -376 to 376)
 
 FN#FLEN(filename$)            Return length of file named
 FN#SLEN(var$)                 Return length of var$
 FN#PARM(var$)                 Number of comma separated parameters of var$
 FN#VALN(var$)                 Return the value of an string array
 FN#ACUM()                     In develop. Do not use it
 _#                            Not available by now
 CHK#(cnd;OKexp;FAILexp)                                If condition is TRUE, returns the value of
                                                                 OK expression, else of FAIL exp
 FILEFIND(key$[;table])                                FileSearch. Return 0=OK, 1=Fail, 2=EoFile
 FILEREL(main;rel;crit)                                Relational Search 0=OK, 1=Fail, 2=EoFile
 FILELOCATE(cmd[;table])                                File Move. cmd$                'NEXT' step forward
                                                                                                 'PREVIOUS' step back
                                                                                                 'TOP'                goto begin
                                                                                                 'BOTTOM' goto end
 FILESEL(file[;acclevel])                                Select files to use on non SQL Databases
 FN$CHNG(main$;mtch$;new$)                Replace ocurrences of mtch$ in main$ for new$
 FN$CHRS(chrvalue)                                                The chr () function
 FN$FECC(date$;mode)                                Date formats: mode 0=Internal, 1=Ext, 2=Width
 FN$FLDS(screendef)                                Returns the value of a Screen Field
 FN$MASK(mask$;v/v#/v$)                                Return then mask formated
 FN$MIDS(var$;offset;size)                                Returns the substring offset, size
 FN$PARM(var$;n)                                                Return the n comma separated param of var$
 FN$SCHG(main$;mtch$;new$)                Replace ocurrences of mtch$ in main$ for new$
 FN$TRIM(var$;md$)                                Retrieve trim blanck chars. md$:
                                                                                 'LEFTTRIM' left retrive
                                                                                 'RIGHTTRIM' right retrieve
                                                                                 'BOTHTRIM' left and right trim
 FN$TXTN(value/value#)                                Returns the string of value/value#
 CHK$(cond;OKexp;FAILexp)                                Same than CHK# but with alpha results
 SORT$                                                                Not usable by now
 EXEC$(prgfile$)                                                Execute prgfile
 READ$(file$[;off[;sz]])                                Return to a string the content of file$
 WRITE$(file$;offset;var$)                                Write var$ to file at offset
 MACRO$(macro$)                                                Return the macrosubstitution of macro ([])
 ENVRON$                                                Return an environmment variable
 _$                                                                Return the last Acumulator
 KEY$([file[;ndx[;mode]]])                                Return key from buff (mode=0)/oldbuf(mode=1)
 TIME$(timeexp;mode)                                Return formats for time
 SQLCHILD(cmdlist)                                Preserve current SQL datas at exec cmdlist

BASIC STRUCTURES
	BASIC STRUCTURES

DOCPARAMS. This basic structure defines the basic data for a document. The syntax is:
[DEVICE [/ LP = H] [/ WD = W] [/ ST = S]] FILENAME

	FILENAME: Filename document (. PDC). This parameter is required.
	DEVICE: Output Device. May be one of the following:
		COMn: baud, p, bits, stop
		LPTn:
		\Server
		Filename.txt
		Filename.pdf
	/LP=n	n defines the length of the page.
	/WD=n	n defines the width of the page.
	/ST=n	n defines the pass line.

Example:
	"COM1:9600,N,8.1 /LP=48 /WD=24,ALBARAN.PDC'

Note: See introduction to documents to use USB devices.

DOCSETS. This structure allows to define expressions that modify the standard behavior of the Document Processor. Its syntax is:
	[ONCEINIEXP], [DOCINIEXP], [DOCCONTINUE], [DOCLOOPCOND]

	ONCEINIEXP will run only once at the start of processing.
	DOCINIEXP will run once each document.
	DOCCONTINUE This is use as evaluator to test final when processing multiple documents.
	DOCLOOPCOND Indicates a selection condition instead of the parameter /COND $

Example: "TYPE=='NEW',AGENT>5,DATE=='2010 331'"

SELECTPARMS. This structure is used to initialize tables or open files. It is used in the screen parameter OPEN$ and in the SELECT command in scripts. The opening parameter is a string of comma separated subparameters and consistent in the table ID or file number, followed by a semicolon and the level of opening: 1 read only, 2 reading and writing. The newest member of the sequence becomes the default table or file. If the parameter is 'RESTORE' restores the state of files. When using OPEN$, restoration is automatic when you close the screen. At the end of a script, also restores the previous state, but it is good programming practice to restore expressly.

Example: 'items;1,Movements;2'
Example: '3;2,4;2,5;1 '

FILESTRUCT. This structure is used to define the fields for a file. These parameters are in the form "FIELD;L;T,FIELD;L;T. .." where FIELD is the field name, L the length and T the type.
Example: "CODE;8;N,ITEM_DESCR;35,;A,PRICE;7;2"

INDEXSTRUCT. This structure defines the indexes of a file. Each comma separated parameter is an index and must be enclosed between <..>. Each index takes a substring of OOOOLLL format, where O is the offset in 1 base and L the length.
Example: "<   1  8  10  2>, <   9  2>". The index is formed with a substring of the buffer over 1.8 10.2, while the second substring index is 9.2.

SCANMODE. This structure defines a way to scan, and optionally supports other parameters:
"MODE [ /FILE=n] [ /INDEX=n] [ /FROM=iKey$] [ /TO=lkey$]".
	MODE can be ACUM or EXPVAL.
	/FILE file defines the data source.
	/INDEX defines the index to use.
	/FROM keyword defines the initial search.
	/TO defines the key end of the process.

FRAMES

DATABASES

INTRODUCTION
	DATABASE - INTRODUCTION

	Datas like any apllicación of this type are organized in tables or files and fields or columns. Tables are defined by a descriptor (a name without special characters). Each field of the table will have a single and unique descriptor within the table. Besides the descriptor, the field is defined by the type and length. Types can be:
	A. alphanumeric
	B. Alphanumeric Digits. (It behaves as alpha but only supports numeric digits).
	D. Dates. Only supports lengths 6/8.
	L. Logical. It only supports lengths of 1.
	N. numeric integer
	1-9. Numeric with n decimal places.
	T. Time.
	Later we will access this data using a very simple syntax of type FIELDTABLE, either for consultation or modification. For example if we have a table called ITEMS and across fields of this table, we have one called PRICE, we can access this data using the expression PRICEITEMS. Of course as with any table, we will get the correct position previously in the row you wish to access. This is automatic in maintenance utilities and movements, but it can be done in a specific way, for example when we write scrpts wifth FILEFIND and FILELOCATE functions.
	Depending on how we access to data rows, there are three types of files, relatives, indexed or SQL databases. This selection is taken at compile time, so that an application can only use one of these types.
FLAT FILES
	DATABASE - FLAT FILES

	The flat files, or relative files consist of files without any indexes, where searches are performed sequentially. Applications using this type of files should be compiled with the module b_dataflat. This is normally used to access files from other applications.
INDEXED FILES
	DATABASE - INDEXED FILES

	Indexed files consist of files with a binary tree index that indexes one or more fields and allows fast access to data. Applications using this type of files should be compiled with the module b_databtree.
	They are typically used in applications that can not access a database, and where also the number of rows is limited (maximum 65535). Applications for mobile phone and similar devices are a good example. They are also used in PC applications that will not have access to a network.
POSTGRESQL
	DATABASE - SQL

	Applications that require access to databases should be compiled with the moodulo b_dataSQL.
 They will usually be PC applications, normally connected to a SQL server.
TRANSACTION TABLES
	DATABASE - TABLES FOR SUPPORT OF TRANSACTION

	When setting up screens for transactions or movements, we can do it very easily through the use of screen movements. But for this to be able, we need a table of transaccines that must meet one requirement: must have a field to support the line number of the transaction and this must necessarily be called "N_LINE".
	Due to the structure of this system development, the index will default to the first field plus the N_LINE field. Furthermore, due to the nature of the tables of movement, there will normally be a date field. For all this is very typical (and this is the orientation of the utility of movements that is supported on this system) that the first field is the identifier (eg transaction number), the second field is the line number and third date.
	When the program AppDesigner detects the field N_LINE in the 2 nd, automatically adjusts the index, so that covers the first two fields, allowing within a transactional document, the lines remain in the same order they were created .
SCREENS

MENUS

INTRODUCTION TO MENUS
	SCREENS - INTRODUCTION TO MENUS

	The type of application referred to in this manual, is almost always the one that start  with a menu.
	There are two types of menus, the tiny type normally used for mobile applications and Windows CE devices, and the full menu.
	The tiny type consists of a list of options, each of which corresponds to a execution sequence (EXEC$). During the execution each option is a button that when pressed starts the option indicated by the parameter EXEC$.
	The full menu is more complex. As a starting point has a list of modules (MODULES$), each of which is the head of a submenu type POPUP. These may have to turn new submenus, until he finally be an option with EXEC$ parameter .
TINY MENUS
	TINY MENU

 	With AppDesigner is configured using a single screen, where each text line is the text of a button.
	The only parameter required to set up Tiny Menu is EXEC$.

FULLY MENUS
	FULL MENU

	Setting up a Complete Menu requires a multi-display setup. They may have only the first screen text (. PAN). All others will be blank screens with configuration parameters.
	Each screen defines a level that points to other screens using the parameter CALLER$. So if the header screen menu has three options and the param CALLER$ is set to "N1,N2,N3 ', the submenus of Option 1 will be on display N1, the 2 in N2, and so... When an option has no new parameters CALLER $, must have a EXEC$ parameter.
PARAMETERS
	SCREENS - MENU PARAMETERS

MODULES$ (Menu Screen)
Sintax1:	MODULES$="opt1,opt2,opt3 ..."
Sintax2:	MODULES$="Module_Description"
Example:	Line 1: MODULES$="10,20,30"
	Line 10: MODULES$="SHOPPING"
	Line 20: MODULES$="SALES"
Notes:	This configuration handle has the function to activate / deactivate
	so easy access to certain destinations menu. The overall menu will not
	include destinations those have not targeted by MODULES$ in  line 1
	NOT AVAILABLE IN TINY MENUS (Windows CE)

MENU$ (Menu Screen)
Syntax:	MENU$="Option_descr, Option_descr..."
Example:	MENU$ = "Providers,Orders,Statistics"
Notes:	This is the next level to MODULES$. It points to the final choices by
	CALLER$ pointer (below)

CALLER$ (Menu Screen)
Syntax:	CALLER$="opt1,opt2,opt3 ..."
Example:	CALLER$="10,20,30"
Notes:	Each option CALLER$ is an index indicating the number of screen
	that resolves the call to this option.
	NOT AVAILABLE IN TINY MENUS (Windows CE)

SUBMENU$ (Menu Screen)
Syntax:	SUBMENU$="Title Options,Option_descr,Option_descr..."
Example:	SUBMENU$="Listings,Alphabetical List,Sequential List"
Notes:	Similar to MENU$, but without triggers (CALLER$) and can not go to higher level
	It is implemented for text compatibility, where the submenu, can have Header
	NOT AVAILABLE IN TINY MENUS (Windows CE)

LOAD$ (Menu Screen)
Syntax:	LOAD$="['file, NP'],['file, NP],...."
Example: LOAD$="'GACOMD.PPN,10','GACOMD.PPN,20',"
Notes:	This parameter indicates the path to expand the menu. It is expected that the route
	has indicated a new MENU$ param.

EXEC$ (Menu Screen)
Syntax:	EXEC$="Process ProcessParms,ProcessParms Process,Process ProcessParms ..."
Example: EXEC$="'MantMain GACOM, 1,0,0,1','Report FILE'"
Notes:	Each subparameter is a destination from the menu or submenu defined at the same level
	The list of Threads is:
	- Menu FILE,NP				Options Menu
	- Accept ACCPARMS			Data Entry
	- MantMain FILE,NP,WW,WH,DF		File Maintenance
	- MantMovs FILE,NP,WW,WH,DF		Transaction Maintenance
	- PrcExec FILE				Script File Execution			
	- Report FILE				Generate a Document
	- Reorg					Access to Reorganization utility.
	- FileTrans				Access to the Transactions utility.
	- Help					Help
MAINTENANCE

INTRODUCTION TO MAINTENANCE
	SCREENS - MAINTENANCE

	The maintenance screens are screens where the fields are, by default associated with a field of file or table. A typical maintenance screen, would be a items screen where on the screen we would have access to different fields of this table, and using buttons you can access other items sequentially (previous - next), or by a direct search.
	This type of screen has the following buttons:
 - New (///). Clears the screen.
 - Home (<<). Accessing the first row of the table.
 - Previous (<). Go to the previous row.
 - Next: (>). Get the next row.
 - Last. (>>). Get the last row.
 - Record. ([x]). Record the current row if there have been changes.
 - Clear. (X). Cancels the current row.
	In addition to the features described, all operations except "Clear" recorded the previous row for any changes in the data.
	The function "Search", is obtained by simply pressing "Enter" in any field that support this type of search (by default only field 1). This feature, unlike the buttons, don'yt record any modified data.
MAINTENANCE SETTINGS
	SCREENS - MAINTENANCE (Settings)

	The basic configuration of a maintenance screen with AppDesigner is very simple, but must keep in mind some limitations of the program. First, the screen size is limited, but in AppDesigner it is unlimited, making it easy to make the mistake of designing a screen that subsequently can not be displayed completely. In the case of programming for a small display device, this question is essential.
	First, it is reasonable to put the text of the window, and a good strategy might be to put dots or dashes, where we want to be the data. But we must have at least two fields (the first will be the default key for searches, for example a code). Once this is done we can test the result in the program database.
	To set the fields, we must locate the cursor in the first position where we want to set the data field and then press the key "|" (ASCII 124) (AltGr 1). This allows us to access a screen where you indicate the number of the corresponding table, the column number, the data type and length.
	Data types are the same as those used to define the tables:

	A. Alphanumeric
	B. Alphanumeric Digits. (It behaves as alpha but only supports numeric digits.
	D. Only supports longitues Dates 6/8.
	L. Logical. 1 only supports lengths.
	N. Numeric integer
	1-9. Númeico with n decimal places.
	T. Time.

	You can also access this screen using the button "Field Attributes".
	Of course, in the application menu should be a button that links to this screen and to indicate to the database is a master maintenance.
	For example suppose we have designed our maintenance screen in a file called MYAPP, the display number 2. To make the link from the menu will indicate on the EXEC$ parameter corresponding to access this button:
	'MantMain MYAPP,2'

	In this type of display, there may be areas that do not correspond to the main table, for example data from another table, or data that comes from evaluting a expression. These fields should use the ASSIGN$ parameter, and will be read-only. By this parameter can also be assigned default values for a screen field.

PARAMETERS
	SCREEN - MAINTENANCE (Settings parameters)

SCREENSIZE$ (Basic Screen)
Sintax:	SCREENSIZE$="widExp,higExp" (Width, Higth)
Sample:	SCREENSIZE$="WID=30;HIG=15;WID,HIG"
Sample:	SCREENSIZE$="30,15"
Notas:	Is processed at the initialization of the display

SET$ (Basic Screen)
Sintaxis:	SET$="exp1[;exp2;[...]]"
Sample:	SET$="TIVA$='4,8,14,18';FPAG=14"
Notes:	It is applied after initialization of the screen and before data preparation

OPEN$ (Basic Screen)
Sintax:	OPEN$="table1;level1[,table2;level2....]"
Sample:	OPEN$="7;1,12;2,15;2"	Files 7(read only) and 12, 15 (read-write)
Sample:	OPEN$="clientes;1,ventas;2"
Notes:	It runs during the initialization of the screen. Allows access to files from this screen
	'table' can be numeric or alphanumeric.
	level may be 1 (Reading), or 2 (read + write)

EDIT$ (Basic screen)
Sintax:	EDIT$="_ID1,_ID2,_ID3...."
Sample:	EDIT$="_CODIGO,_NOMBRE$,_DIRECCION$"
Notes:	Defines the order of editing screen fields.

NOEDIT$ (Basic Screen)
Sintax:	NOEDIT$="_ID1,_ID2,_ID3...."
Sample:	NOEDIT$="_T.COMPRAS,_T.PAGOS"
Notes:	Defines the read only fields.

WRITE$ (Basic Screen)
Sintax:	WRITE$="exp1[;exp2;[...]]"
Sample:	WRITE$="SAVED=1"
Notes:	It is executed at last field confirmation. (ON OK)

DOC$ (Basic Screen)
Sintax:	DOC$="'DEVICE[ /LP=n][ /WD=n][ /ST=n]',DOCFILE$"
Sample:	DOC$="'LPT1 /LP=72','FACTURA.DOC'
Notes:	Defines the document to print after data saving (MOVS)
     	LP=Lines per page
     	WD=Widht of the page
     	ST=Interline step
     	See Basic Structures.

DOCSET$ (Basic Screen)
Sintax:	DOCSET$="[ONCEINIEXP],[DOCINIEXP],[DOCCONTINUE],[DOCLOOPCOND]"
Sample:	DOCSET$="TIPO=='NEW',AGENTE>5,FECHA=='2010 331'"
     	Printing starts when the annotation type is a 'NEW'
     	Only print data related to agents over 5
     	The printing end at the conclusion in March 2010
Notes:	ONCEINIEXP Evaluated at the begining of the printing.
     	DOCINIEXP Evaluated at the begining of a document.
     	DOCCONTINUE Evaluated at the end of a document to continue with next or ends.
     	DOCLOOPCOND It allow to stablished a condition instead of the parameter /COND$
     	See Basic Structures.

HELP$ (Basic Screen)
Sintax:	HELP$="HELPFILE,PAGE"
Sample:	HELP$='scr_main.hlp,8'
Notes:	Defines the help page for the entire screen, applying to
     	each field a next page. see also HELPFLD$ (Fields)

RELOPT% (Basic Screen)
Sintax:	RELOPT%=exp1
Sample:	RELOPT%=1
Notes:	Defines el update criterium (??RELUP.DAT) for the screen.

UNICNDX% (Basic Screen)
Sintax:	UNICNDX%=exp1
Sample:	UNICNDX%=0
Notes:	Specifies exclusive key on an index (In the sustens wich allow it)

AUTONDX% (Basic Screen)
Sintax:	AUTONDX%=exp1
Sample:	AUTONDX%=1
Notes:	Specifies automatic key.

SCREEN FIELD PARAMETERS
	SCREENS - MAINTENANCE (Field Settings parameters)

FD$ (Field Attributes)
Sintax:	FD$='_SCRF1$,_SCRF2$,_SCRF3$...'
Sample:	FD$='_CUSTOMER$,_ADDRESS$,_TELEPHONE$,_SALES#'
Notes:	Specifies the display field identificator. It should start with _, and
	the last character must be $ for alphanumeric fields to, # for the numeric fields
	and none of the integers. If not specified, the identifier
	by default is _SCRFn? the last character appropriate.

ALARM$ (Field Attributes)
Sintax:	ALARM$="EXP1,EXP2,EXP3"
Sample:	ALARM$="_SCRF1$>'',,,_SCRF4>1&&_SCRF4<3"
Notes:	Specifies the conditions for a field to be accepted. blank
	represents no condition.

ASSIGN$ (Field Attributes)
Sintax:	ASSIGN$="EXP1,EXP2,EXP3"
Sample:	ASSIGN$=",,FN$TRIM(_SCRF1$)+' '+_SCRF2$"
Notes:	Specifies the default data when needed.

LNASSIGN$ (Field Attributes)
Notes:	Undocumented by now.

FILEDEF$ (Field Attributes)
Notes:	Undocumented by now.

PERFORM$ (Field Attributes)
Notes:	Undocumented by now.

UPDFIELDS$ (Field Attributes)
Notes:	Undocumented by now.

WIDTHS$ (Field Attributes)
Sintax:	WIDTHS$="w1,w2,w3..."
Sample:	WIDTHS$=",,,20,20,20"
Notes:	Specifies the area visible on the screen for each field.By
	defect, the field width is allocated as a screen parameter
	but this setting allow to view only a portion of data.

TYPES$ (Field Attributes)
Notes:	Undocumented by now.

FLDHELP$ (Field Attributes)
Sintax:	FLDHELP$="filename,screenNum"
Sample:	FLDHELP$="help.txt,2"
Notes:	When a field needs additional information to the user
	(help), you can specify here which is the file containing
	and index information in the file. The help files
	have a numerical index of two characters wide and the help text.

TRANSACTIONS

INTRODUCTION TO TRANSACTIONS
	SCREENS - MOVEMENTS

	Traditionally, systems analysts have been talking for decades about master files and transaction files. Today, we talk about tables, but the concepts remain the same, although we talk about transaction tables, adopting the Anglo-Saxon style (transaction files). A transaction table is ultimately a table where operations are registered normally with a date and sometimes an hour applied to an element of a non-transactional table. An example may be a withdrawal funds from an ATM. In this case the non transactional element is the account number, while the transaction data includes the date, time, the amount withdrawn and the account number.
	This type of management of transactions is consider in our development system, under two points of view, different in appearance, but very similar in operation, tiny movements and fully movements. The difference is the number of screens needed to complete the operation. While the tiny movements, aimed at small-screen devices, typically used two or three screens, full motion, aimed at PCs are developed on a single screen with a central element of lines.
	So in a typical application of tiny movements, we have a first screen where you enter data common to the transaction, such as account number. We now turn to the "lines of movement", but each line is a full screen, moving to "next screen", "previous screen" to access the next or previous line (annotation). Finally we have a summary screen to complete all the transaction.
	This in a PC application, we would have a header, with information common to trasacción, a grid of lines for the movements, and optionally a foot or summary completion of the transaction.

TINY TRANSACTIONS
	SCREENS - TINY MOVEMENT (settings)

	To setup a screen of tiny type movements, we wil set up two or, if we need a foot or summary of movement, three screens.
1. Display data header. This screen is configured in the same way as a maintenance screen with one limitation: The first field should be the first field in the table as it has to be the first field of lines screen (next screen). In most cases, one of the following fields is a date, and usually also be a cross-reference to a master file, such as an account number. If we want the cross-reference or call relational, we present additional information such as account name, we can add a field for this purpose. To activate this field we need a trigger (trigger) is activated by modifying the relational field (see triggers in advanced screen).
2. Screen lines. This screen will be the one wich accepts the different items associated with the main header (see Transaction tables in databases). The first field in this screen should be the same as in the first, or, whether a field of the main table. Furthermore, to avoid incorrect modifications by the user, must be a read-only field (NOEDIT$)
3. Summary screen. this is optional and has no special requirements, since it is only informative. If it requires some user input on this screen should be associated with an internal variable for further processing during data recording (FTCLC$ and  FITCLC$).
	To move from screen to screen, use the buttons at the top (<) for the front and (>) to the rear. For the summary, and thus conclude the input lines, you should use the cursor key down.
	A document already recorded, can be edited or deleted. To do this, in the first screen, we enter the document code to query, and press the "Enter" key.
FULLY TRANSACTIONS
	SCREENS - FULL TRANSACTIONS (PC) (Settings)

	Undocumented. See the documentation on-line to check changes at www.dsoft.es.

PARAMETERS
	SCREENS - TRANSACTIONS (Parameter Settings)

WRITECAB(n)$ (Transaction Screens)
Sintax:  	WRITECAB(n)$="exp1[;exp2;[...]]"
Sample: 	WRITECAB0$="T.AMOUNT=#TOTAL"
Sample: 	WRITECAB1$="VAT=19.5;NLINE=1"
Notes:	It is processed in the writing of summary lines. The 0 is applied to
	all records in summary, 1 only the first record, and so on ...

WRITELINS$ (Transaction Screens)
Sintax:  	WRITELINS$="exp1[;exp2;[...]]"
Sample: 	WRITELINS$="CUSTOMER=_CUSTOMER$;ITEMCODE=_ITEMCODE$"
Notes:	It is processed in the writing of lines of detail. The system repeats
	expression as many times as lines in the document.

FITCLC$ (Transaction Screens)
Sintax:  	FITCLC$="exp1[;exp2;[...]]"
Notes:	Undocumented by now.

FTCLC$ (Transaction Screens)
Sintax:  	FTCLC$="exp1[;exp2;[...]]"
Notes:	Undocumented by now.

ALARMLINS$ (Transaction Screens)
Sintax:  	ALARMLINS$="exp1[;exp2;[...]]"
Notes:	Undocumented by now.

NUMCAB$ (Transaction Screens)
Sintax:  	NUMCAB$="exp1[;exp2;[...]]"
Notes:	Undocumented by now.

BOUNDS$ (Transaction Screens)
Sintax:  	BOUNDS$="exp1[;exp2;[...]]"
Notes:	Undocumented by now.

BEGINFLD% (Transaction Screens)
Sintax:  	BEGINFLD%$="exp1[;exp2;[...]]"
Notes:	Acualmente sin documentar.

SCRLIN% (Transaction Screens)
Sintax:  	SCRLIN%="exp1[;exp2;[...]]"
Notes:	Undocumented by now.

MAXLIN% (Transaction Screens)
Sintax:  	MAXLIN%="exp1[;exp2;[...]]"
Notes:	It allows to define tha máximum number of lines in the
	document. (100 by default).

DATA CAPTURE (ACCEPTS)

INTRODUCTION TO DATA CAPTURE (ACCEPTS)
	SCREENS - ACCEPTS

	Undocumented. See the documentation on-line to check changes at www.dsoft.es.

DATA CAPTURE (ACCEPTS)
	SCREENS - ACCEPTS (Settings)

	Undocumented. See the documentation on-line to check changes at www.dsoft.es.

PARAMETERS
	SCREENS - ACCEPTS (Parameter Settings)

	Undocumented. See the documentation on-line to check changes at www.dsoft.es.

ADVANCED SCREEN SETTINGS

TAKING DATA FROM EXTERN (ASSIGN$)
	SCREENS - ADVANCED SETTINGS - ASSIGNS

	Undocumented. See the documentation on-line to check changes at www.dsoft.es.

RELATIONAL SEARCHES (TRIGGERS)
	SCREENS - ADVANCED SETTINGS - TRIGGERS

	Undocumented. See the documentation on-line to check changes at www.dsoft.es.

DOCUMENTS

INTRODUCTION
	DOCUMENTS - INTRODUCTION

	Any non interactive document, is considered a document. They may be reports, lists, or summaries on screen. A document is therefore a collection of data presented properly. Documents may be targeted to the screen itself, or a pipe, either a file, a serial port or a port of another type, such as a printer parallel port.
	In all cases the impression is text, so that the receiving device must support this type of data. The destination files when you select this output will always be pure text, including PDF, which meet the specifications of this type of format, but only contain text (can contain a header, or logo, but this data will be fixed).
	When we wish to direct printing, we print to an LPT port, either real or virtual. This therefore allows printers to print on USB, but must be configured as LPTx as capture printer port to the network resource previously shared. However, for direct print, printers must support low-level printing, so you can not print directly to GDI (Graphical Device Interface) printers or Win Printers. In these cases, the impression must be made via PDF or txt, using acroread or texteditor to print.
	The documents are set up as templates for later use from any utility of printing, either DOC$, from screen or REPORT from scripts.
 .
SETTINGS
	DOCUMENTS - SETTINGS

	The configuration of documents is usually done with AppDesigner. The basic concept is to design a line of print masks, separated by a separator mask, followed by a final line separator (printing), followed by the list of expressions for each mask. The concept is closer to LPRINT USING (basic) that printf (c).
	An example would be:

Name:                                        | amount: ###,###.## ¦ 'John Smith', 32415.25 [parameters]

	In this example we have two masks, masks separator <|>, the final line separator <¦> and two data, the first alphanumeric and the second numeric.
	The masks can only be alphanumeric and numeric, masks separator is "|" (AltGr-1) (Alt 124), data can be fixed or variable, but must match the type of mask. So an alpha mask, must correspond a fixed data type 'aaa', variable of type alpha (completed in $) or an alpha field (or active display table / file). The numeric mask may have correspondence in a fixed number, an integer variable (no $ or #), a numerical (#), or a numeric field.
	The end of line separators (¦) can be of three types, normal, feedback or loop. The standard separator indicates that the line is printed only once in the particular position in which it is in the document. The separator loop, indicating that begins a list of lines from the position of the line to the next line or to the order page. Used to list lines. The retro-type separator, is designed as a line of summary at a variable position, and then has to be a loop. A typical use would be to partial and total sums.
 
SCRIPTS

INTRODUCTION
	SCRIPTS - INTRODUCTION

	The scripts or procedures allow the edition of programs that can use the basic structures of the system, in a simple and versatile way. They are text files, editable with any text editor that support text format or with AppDesigner.
	This is a standard language, similar to the basic, with the usual flow controls, plus a series of commands oriented to data management. If you have the libraries of the system, it is possible to add commands of your own creation, programmed in C or C ++, but according to your operating system, could be programmed in other languages.
	The scripts can be used in two ways, as independent procedures launched from a menu, similar to a maintenance or a report, or from any expression using the EXEC$ function. The normal strategy in the second case, is not to use commands, but merely data collection, although a cautious programmer has available all the power the entire system. As a convention PRC extensions are used for the first type of scripts and extensions for the second type is PRX by default.
	The basic syntax to start a script from a menu would be:
	PrcExec PROCCALLER$
	The syntax for a script to start from a function is:
	 EXEC$(PROCCALLER$)
	In both cases, PROCCALLER$ will be the script file name, optionally followed by the descriptor of the start tag, separated by ";". Here we can see some examples:
	PrcExec 'PROG.PRC'
	PrcExec 'PROG.PRC;SUBPROC_A'
	EXEC$('PROG.PRX')
	PROGCALLER$='PROG.PRX;SUBPROC_A';EXEC$(PROGCALLER$)

SCRIPTS PROGRAMMING
	SCRIPTS - PROGRAMMING

	As with any programming language, we will see the general syntax first, followed by flow controls and at last, the commands reference.

	SYNTAX

- The programs are structured by lines. A line is a command or flow control with its parameters. The remmarks is identified by a ; (semicolon) at the first character.
 - There are no line numbers. The subroutines are carried out by calls to labels. A tag is a line that begins with : (colon)
 - The line syntax is, for both flow controls to the following commands:
	COMMAND [PARAMETER1][,PARAMETER2[,PARAMETER3...]]]
- The parameters can be integer data, numeric or alphanumeric.
- Now some examples:
	GOSUB 'LABEL1'
	DEVICE DOCFILE$
	FILESELECT '1;2,2;1,4;2'
	DO_WHILE A<3
	.............
	LOOP
	:LABEL1

	FLOW CONTROLS

- GOTO LABEL$. Continue execution at the label LABEL$. The parameter must be alphanumeric.
- GOSUB LABEL$. Call to subroutine LABEL$. The parameter must be alphanumeric.
- CALL PRGFILE$[,LABEL$]. Call to a subroutine in an extern module. The parameters must be alphanumeric.
- RETURN. End of subroutine. No parameters.
- ENDIF. End of conditional sequence. No parameters allowed.
- LOOP. End of a loop secuence. No parameters allowed.
- LOOP_WHILE COND_EXP. Conditional end of a loop secuence. The secuence will be repeated if the expression result is true.
- LOOP_UNTIL COND_EXP. Conditional end of a loop secuence. The secuence will be repeated if the expression result is false.
- ELSE. Begin of an alternative conditional sequence. Sequence is initiated when the previous IF does not start. No parameters allowed.
- IF COND_EXP,IF_TRUE COND_EXP. Begin of a conditional secuence. The secuence is executed when the condition is true.
- DO_WHILE COND_EXP. Conditional begin of a loop secuence. The secuence will be initiated or repeated if the expression result is true.
- IF_FALSE. COND_EXP.  Begin of a conditional secuence. The secuence is executed when the condition is false.
- DO_UNTIL COND_EXP. Conditional begin of a loop secuence. The secuence will be initiated or repeated if the expression result is false.
- DO. Start unconditional repeat sequence. No parameters allowed.
- END. Final of the script. The script ends execution without errors.

COMMAND REFERENCE
	SCRIPTS - REFERENCE

	CONSOLE COMMANDS

- ACCEPT. Undocumented.
- BOUNDS "'PROMPT1:':'TL':STORE_VAR[:INIT_VAR]['PROMPT2:':'TL':STORE_VAR[:INIT_VAR]...]]". Opens a data capture window. Each parameter consists of a prompt, which must be an alphanumeric expression, a descriptor of type and length as A10, N6, D8, etc (see screen field types), a variable where to save the input, and an optional variable with the default value of the field. The last two parameters should be compatible with the type, to avoid TYPEMISMATCH errors.
- COLOR. Undocumented.
- LOCATE ROW, COL. Position the cursor inside a window to the position indicated by the parameters.
- MENSJE TEXT$. Generates a text message.
- PRINT TEXT$. Output text to the current active window.
- READ. Makes the data capture of previous ACCEPT commands.
- WINMENU MENUOPTIONS$. The parameter must be a number of options separated by commas. The result of the menu remains on the variable _STAT.
- WINOPEN ROW,COL,WINTITLE$. Open a window at the position row, col, with WINTITLE$ as the title. If WINTITLE is the string 'PROGRESS', opens a progress bar, where ROW is the width of the bar and COL is the full extension of progress.
- WINCLOSE ['PROGRESS']. Close the last open window. To close a progress bar to indicate the parameter 'PROGRESS'
- WINSELECT. Undocumented.

	INPUT AND OUTPUT COMMANDS

- CONNECT. Undocumented.
- DEVICE DOCPARAMS[,DOCSETS]. Opens a pipe to output. Successive DLOCATE and DPRINT commands will be send to this device. See the introduction to documents to see the pipes available. See basic structures.
- DLOCATE ROW,COL. Allocates row and col in an open pipe.
- DPRINT TEXT$. Output text to an open pipe.
- ENDDEVICE. Close the output pipe.
- READ_FROM. Undocumented.
- REMOTE. Undocumented.
- REPORT DOCPRM$,DOCSET$. Generates a document. The parameters of this command are the same as for the parameter DOC$, basic screen (maintenance). See Basic Structures
- SHELL COMMANDLINE$. Executes an operating system command.
- SYSTEM COMMANDLINE$. Executes an operating system command.
- WAIT. Undocumented.

	TRANSACTION COMMANDS

- EXPORT. Undocumented.
- IMPORT. Undocumented.

	DATA ACCESS COMMANDS

- FILESELECT SELECT$. Allows to open and close files. The opening parameter is a string of comma separated subparameters consisting of the ID or file number, followed by a semicolon and the level of openness: 1 read only, 2 reading and writing. If the parameter is 'RESTORE' restores the file state before the last SELECT.
- KILL FILENAME$. Deletes a file from the disk.
- LOADSTRUCT 'AI'. Upload a file structure. The identifier must be the first two digits of the file structures. For example to load the file APDICC.DAT, the AI (App ID) is AP.
- RC_DELETE [FILE]. Deletes the current record from the specified file, or from the default file.
- RC_INSERT [FILE]. Insert the active record from the specified file, or from the default file.
- RC_SEEK. Undocumented.
- RC_WRITE [FILE]. Save the active record from the specified file, or from the default file.
- FILESTRUCT FILENME$,FILESTRUCT$,INDEXSTRUCT$. Defines a temporary file structure. The first parameter is the name of the file. The second and third parameters correspond to structures described in the section of basic structures.
- FILESCAN SCANMODE$,CONDITION$,EVAL$. The struture SCANMODE is described in basic structures. In all cases are processed records matching CONDITION $, and the expression is applied $ EVAL. If the mode is EXPVAL is continuous, but if the mode is ACUM, after each execution of EVAL$, the process make a key search on the main file, and if not matched, it will be be inserted. If there is a match, EVAL is repeated and recorded.
LIBRARIES

MEMORYLIB

MALLOC32
MemoryLib - Malloc32 Functions

xstring Acumulator (void);
xindex AcumulatorPoint (xindex acpoint);
width AcumulatorFreeRoom ();
xstring AcumulatorSetAtPoint (xindex point, xstring value);
voidptr MemAlloc (xindex funcIdef, width size);
pointer MemAllocate (xindex funcIdef, width size);
xstring MemAllocString (xindex funcIdef, xstring source);
xindex MemClose (logical force);
erridef MemFree (xindex funcIdef, voidptr idef);
infomemory MemInfo (void);
erridef MemInit ();
void MemInitSet (xindex mxacums, xindex mxstacks, xindex mxblocks);
erridef MemRestore (xindex funcIdef, int memareas);
bstring TempString (xindex funcIdef, width size);
erridef TempStringRelease (xindex funcIdef, bstring tempstr);

SPMEM32
MemoryLib - spmem32 Functions

xstring _str_result (xstring result, erridef errcode);
smallint AsctoInt (xstring strvalue);
smallint DefaultInt (smallint value, smallint defvalue);
xstring DefaultStr (xstring string1, xstring string2);
offset FirstPosAny (xstring mainstring, xstring matchs, xmode strmode);
offset FirstPosChr (xstring mainstring, smallint match, xmode strmode);
offset FirstPosString (xstring mainstring, xstring match, xmode strmode);
xindex FirstPosValue (VOIDPTR *numlist, xindex listunits, VOIDPTR *value, width valuewid);
offset LastPosAny (xstring mainstring, xstring match, xmode strmode);
offset LastPosChr (xstring mainstring, smallint match, xmode strmode);
offset LastPosString (xstring mainstring, xstring match, xmode strmode);
logical LogicValue (xstring value);
smallint MaxValue (smallint xvalue, smallint yvalue);
smallint MemCompare (voidptr mem1, voidptr mem2, width wid);
smallint MinValue (smallint xvalue, smallint yvalue);
xstring PrcParam (xstring mainstring, smallint separator, xindex parmnum);
xstring PrcParamAdd (xstring mainstring, xstring separator, xstring addparm);
xstring PrcParamFit (xstring mainstring);
smallint PrcParamInt (xstring mainstring, smallint sep, xindex parm);
xstring PrcParamNextDef (xstring mainstring, smallint sep);
width PrcParamNextSize (xstring mainstring, smallint sep);
erridef PrcParamSet (xstring mainstring, xstring param, smallint sep, smallint parm);
substring PrcParamSub (xstring mainstring, smallint separator, xindex parmnum);
width PrcParamWid (xstring mainstring, smallint separator, xmode mode);
xindex PrcParmNum (xstring mainstring, xstring match, smallint separator);
xindex PrcParms (xstring mainstring, smallint sep);
xstring PrcParmTrim (xstring mainstring, xmode mode);
substring PrcParmSub (xstring mainstring, xstring match);
erridef PrcParmValue (xstring mainstring, xstring match);
xstring PrcParmValueStr (xstring mainstring, xstring match);
erridef PtrInBounds (xstring buffer, xindex vindex, smallint msize);
smallint PtrValueInt (xstring buffer, xindex vindex);
smallint PtrValueIntSet (xstring buffer, xindex vindex, smallint value);
numtype PtrValueNum (xstring buffer, xindex vindex);
numtype PtrValueNumSet (xstring buffer, xindex vindex, numtype value);
xstring StrBuffSet (bstring *buffer, xstring strset, offset pos);
smallint StrCompare (xstring string1, xstring string2);
xstring StrConcatStr (xstring string1, xstring string2);
erridef StrChrChng (xstring mainstring, xstring match, xstring newmatch, xmode strmode);
xstring StrChrChngStr (xstring mainstring, xstring match, xstring newmatch, xmode strmode);
xstring StrChrChngCase (xstring text, xmode mode);
logical StrChrsCheck (xstring text, xstring charlist);
xstring StrChrsChng (xstring mainstring, xstring charstochange, xstring replaces, smallint separator);
xindex StrChrCount (xstring mainstring, xstring match, xmode strmode);
xstring StrCopy (xstring source);
xstring StrCopyTo (xstring source, pointer destination, offset pos);
pointer StrCstyle (xstring mainstring);
xstring StrDefault (xstring mainstring, xstring defstring);
xstring StrEnveloped (xstring string, char enveloper);
erridef StrErrCode (xstring string);
xstring StrFit (xstring mainstring);
xstring StrISOcnvt (xstring text, pointer chrstoreplace, pointer chrsreplaced);
xstring StrQuoted (xstring value, char quotmark);
xstring StrRepeat (xstring mainstring, xindex count);
xstring StrSub (xstring mainstring, smallint offset, width subwid);
substring StrSubDelimited (xstring mainstring, xmode fposmode, char idelim, char udelim);
xstring StrSubSet (xstring mainstring, smallint offset, xstring set);
voidptr StrUnicode (xstring mainstring);
xstring StrX (pointer strptr);
xstring StrXcnv (pointer strptr, width strwid);
xstring StrXUnicode (void *unicode);

SPSTR32
MemoryLib - spstr32 Functions

erridef StackClear (xindex stringidef, xindex parm);
xindex StackParms (xindex stringidef);
erridef StringAssign (xindex stringidef, xindex stringsub, xstring mainstring);
erridef StringClose (void);
xstring StringDef (xindex stringidef, xindex stringsub);
erridef StringDelete (xindex stringidef, xindex stringsub);
erridef StringErase (xindex idefs);
width StringFree (xindex stringidef);
erridef StringInit (xindex idefs, xindex stringmax, width size);
erridef StringInitDef (void);
xstring StringStkDef (xindex stringidef);
erridef StringStkDel (xindex stringidef);
erridef StringStkPut (xindex stringidef, xstring value);

SPMATH32
MemoryLib - spmath32 Functions

numtype atonum (pointer buffer);
xstring ExternValue (numtype value);
xstring InttoBuffer (smallint value, pointer buffer);
xstring LongtoBuffer (long value, pointer buffer);
xstring InttoRightBuff (smallint value, width wid, char fillchar, pointer buffer);
xstring InttoStr (smallint value);
xstring LongtoStr (long value);
pointer numtoa (numtype value, pointer buffer, smallint radix);
xstring StrValue (numtype value);
numtype ValueAdjust (numtype value, smallint valuedecimals, smallint decimals);
numtype ValueDiv (numtype divident, numtype divisor);
numtype ValueNum (xstring value);
numtype ValueIntern (xstring value);
pointer xitoa (int value, pointer buffer, int radix);
pointer xltoa (long value, pointer buffer, int radix);

SPERR32
MemoryLib - sperr32 Functions

erridef ErrorCode (int swit, xindex function, erridef errcode, erridef result);
errstat ErrorStat ();
xstring ErrorString (int swit, xindex function, erridef errcode, xstring value);
xstring ErrorText (erridef errcode);
erridef ErrorSysMsje (erridef reterrcode, xstring msje, xstring linefeed);