Using Dossier for Windows 1. Installation Please see the file READ.ME included on the demonstration diskette for installation instructions. The DOS command SHARE must be executed before DOSSIER for Windows is executed (see the file READ.ME file for more information). If you have any questions please call: 1 (800) 477-7147. 2. Getting Started Menubar Choices: File New - Prepares a new Dossier for Windows program file and clears the main window. (see section 3, page 1 for more information on Dossier for Windows program files). Open - Opens a Dossier for Windows program file. Run - Runs a Dossier for Windows program file. Run Report - Runs a default report or a user specified report. Run Total - Runs a default report or a user specified total. Run Function - Runs a user specified function. Close - Clears the main window. Save - Saves a Dossier for Windows program file. Save As - Saves a Dossier for Windows program file to a user specified name and location. Print Source - Prints the contents of a Dossier for Windows program file. Pack - Permanently removes all records marked as deleted from the database. Pack Memos - Compresses memos. Exit - Ends a Dossier for Windows program. Edit New Record - Creates a new record and allows input into a default dialog window. Delete Record - Marks a record as deleted. Cut - MS-Windows clipboard Cut command. Copy - MS-Windows clipboard Copy command. Paste - MS-Windows clipboard Paste command. Search Key - Displays the index file key for the current database. Top - Moves the record pointer to the top of the database Bottom - Moves the record pointer to the bottom of the database. Go To.. - Moves the record pointer to a user specified record number. Locate - Lets the user specify a search condition. Range - Displays records within a specified range. Skip Deleted - Hides records marked as deleted. Select Home Directory - Specifies the home directory where files will be saved by default. DataBases - Selects a database. Columns - Allows the user to modify the browser columns. Filter - Allows the user to enter a filter expression and to filter out specified records. Fonts - Allows the user to select various system fonts. Dialogs (see Section 14, page 9 for more information on creating and using dialogs). New - Allows the user to create a new dialog window. View - Allows the user to view an existing dialog window. Delete- Allows the user to delete an existing dialog window. Rename- Allows the user to rename an existing dialog window. 2. Getting Started Menubar Choices: (continued) Controls Push Button - Allows the user to create a MS Windowsstyle push button. Radio Button - Allows the user to create a MS-Windows style radio button. CheckBox - Allows the user to create a MS-Windows style check box. Horz Scroll - Allows the user to create a MS-Windows style horizontal scrollbar. Vert Scroll - Allows the user to create a MS-Windows style vertical scrollbar. Edit - Allows the user to create a MS-Windows style edit box. Text - Allows the user to create a MS-Windows style text box. Group Box - Allows the user to create a MS-Windows group box. List Box - Allows the user to create a MS-Windows style list box. Combo Box - Allows the user to create a MS-Windows style combo box. Frame - Allows the user to create a frame. Icon - Allows the user to place an icon on a dialog box. Rectangle - Allows the user to place a rectangle on a dialog box. Position - Allows the user to position dialog controls using an axis. Groups - Allows the user to order the tabbing between fields. End Editing - End the editing session, query save. Attach to File - Allows the user to set a dialog window as the primary dialog for a browse window. Preface/Wrap-up - Attach programming code to the entry and exit expression blocks of a DPR file. Report - Create and edit reports. Total - Create and edit numeric reports. Function - Create and edit global functions. Window - Tile - Cascade - Arrange Icons - Close All - MDI child window handling commands Utilities Evaluate Expression - Edit and evaluate an expression. Create/Modify DataBase - Create or Modify the structure of a .DBF file. Copy To - Export data to another .DBF file. Append From - Import data from another .DBF file. Scan Records - Scan a .DBF via an expression. Count Records - Count records via an expression. Sum Expressions - Sum values accross records. Help About Dossier - Dossier for Windows About box. 3. What is a DOSSIER for Windows Program File ? Dossier for Windows uses program files as the highest organizational level within the program. Dossier for Windows program files have the file extension .DPR. At all times, a DPR file is is being maintained by the program. When an application is not being run, an empty sand, untitled .DPR file is available. If the user loads or creates any databases, index files, dialog windows, functions, reports, totals, filters, relations or other program items, these items are logged into the current .DPR file. The .DPR file can then be saved to a named file for future access. Understanding .DPR files As the user creates or opens database files, index files, function blocks, dialog windows, relations and other elements of the current user application, the user may wish to save the current status of the user's work in a file for later automatic restoration. For instance, as the user creates databases, creates functions, sets filters, sizes and position windows on the screen, etc., it becomes apparent that without such a mechanism, the tedium of restoring an application repeatedly would limit the usefulness of the program. The mechanism used by Dossier for Windows to save and restore currency in an application is the Dossier for Windows program file or .DPR file. The FILE main menu pulldown is designed to facilitate the use of .DPR files. A common point of confusion to users is that this menu item operates on .DBF files. A Dossier for Windows program file is always maintained by the program. Even when no application is being run, the program is maintaining an empty and unnamed .DPR file. Therefore, creating, opening and closing Dossier for Windows program files, or .DPR files, is synonymous with creating, opening and closing user applications. The term DPR file and the term application will be used where appropriate, but they refer to the same entity. For instance, the user may end the current application by closing the current DPR file. In this case, ending the current appilcation and closing the DPR file refer to the same action. NEW: clearing the slate By selecting NEW from the FILE main menu pulldown, the current DPR file is cleared from memory and an empty, unamed DPR file is created. The user will be prompted to save the current application to the current DPR file if any modifications to the current application have not yet been saved. The NEW menu choice removes the current DPR file. This occurs when the users wishes to build a new application. After selecting the NEW options from the FILE main menu pulldown, the user is free to create a new application. Dossier for Windows program files must carry the file extension DPR. The File Open dialog will not allow files with any other file extension to be loaded. OPEN: loading an existing application The OPEN submenu choice available from the FILE main menu pulldown used to load and execute an existing Dossier for Windows program file, or .DPR file. After the user selects the OPEN menu choice, the File Open dialog box will appear. RUN: executing an application The RUN submenu choice will be available to the user only when a .DPR file has been loaded into the system, or a new application has been created by the user. This command toggles with the CLOSE command from the same menu. Iif the user elects to execute an application by selecting the RUN command, the CLOSE command may be selected to stop executing the application. Running an application in Dossier for Windows is the means by which Dossier for Windows performs work. Running an application will cause one or more database browse windows to appear. Depending on the complexity of the application, there can be a variety of windows on the screen. The user may see message boxes, notifying the user of index file operations, dialog boxes for application login, prompts for information or a variety of miscellaneous events. Dossier for Windows is a programmable database management system, and as such, allows the application developer considerable control over the running of the user application. As the user becomes more familiar with the product, the user will be able to add these advanced features to any applications he or she has developed. 4. Browse Windows The most common result of selecting RUN from the FILE main menu pulldown will be the appearance of one or more browse windows. Browse windows are the default mechanisms by which data is viewed in Dossier for Windows. If the user selects a database for viewing or editing, the program will automatically build a browse window for that database. The browse window is the simplest, most straightforward possible view of that database's data. The names of the fields will be displayed across the top of the window along with the field contents of the various records. Much more complex browse window schemas may be constructed with Dossier for Windows, but this simple browse scheme is created as a point of departure for more complex designs. Browse window column header display The column header display area of a browse window is the control point for the display of information within the rest of the browse window. The browse header display can be used to edit the display of columns, create new columns based on expressions built up from the datafile, change the width of a column, and swap column positions. Changing the width of a browse window column When the user positions the mouse cursor over the column header display, and moves the mouse across the display, the mouse cursor will toggle between two states. When the cursor crosses over a column divider, the cursor will change to a column resize cursor. As the user presses down the left button of the mouse, the user will be able to move the column divider to a new position, resizing the column to the immediate left of the cursor, which will appear inverted. The column resize cursor Swapping the order of browse window columns When the user positions the mouse cursor over the column header display, and the mouse cursor is not positioned over a column divider, the mouse cursor will appear as the pointing hand cursor. The pointing hand cursor At this point, if the user keeps the left mouse button pressed, the cursor will change to the column swap cursor. The user moves the column swap cursor over to the desired new position for the selected column, and then releases the left button. The selected column will now appear in the position formerly occupied by the column now under the cursor, while the column under the cursor will have been swapped over to the original position of the selected column. The column swap cursor Editing the display of browse window columns When the user positions the mouse cursor over the column header display, and the user double clicks the right mouse button, the column display editing dialog will appear. Browse column selection listbox The browse column selection listbox will be prepopulated with all the available column headers, in left to right order, of the current browse window. By double clicking with the left mouse button, the user selects any entry for editing. The expression entry field and heading entry field will display the expression and heading name. Browse window record editing By double clicking on any row of the browse window record display area, the user is informing the system that the user wishes to edit that particular record. By default, Dossier for Windows will have created a record editing dialog box or several dialog boxes, for every database file that the user selects into his Dossier for Windows application. This dialog box will appear over all other windows in the system. The focus will be set to the first editable field within the newly activated dialog box. The fields of this dialog will be prepopulated with fields from the user selected record. This is the default behavior of the system. Experienced Dossier for Windows application developers will be able to extensively modify the behavior of the program, so that any number of actions will occur when the user selects a record from a browse window for editing. Users should first familiarize themselves with the default behavior of the system before they delve into more advanced capabilities. (run bills.dpr) The record editing dialog for an application is activated when the user double clicks a row of the browse window. The user types in any changes to any field, and accepts the record editing session by means of the OK pushbutton or the Enter key, or cancels the record editing session by means of the Cancel pushbutton or the Esc key. 5. Create a Database To create a database select the menu item Utilities, then select the menu item Create/Modify Databases. Enter the name of the database you wish to create. Dossier will prompt you that the database is not located. Then an edit dialog box will appear. Enter a field name, type, and width and then select the dialog button Set. Repeat the above commands till the database is complete. Example: Create a database named NAMES.DBF - select menu item Utilities - select menu item Create/Modify DataBase - enter NAMES.DBF - select dialog button, Ok - select dialog button, YES - enter Field Name: NAME - select Type: Character - enter Width: 20 - select dialog button, Set (Set enters the field name, type, width, decs into the fields column, Ok will use the fields information to create a database) - enter Field Name: ADDR - select Type: Character - enter Width: 30 - select dialog button Set - enter Field Name: CITY - select Type: Character - enter Width: 15 - select dialog button, Set - enter Field Name: STATE - select Type: Character - enter Width: 2 - select dialog button, Set - enter Field Name: ZIP - select Type: Character - enter Width: 5 - select dialog button, Set - enter Field Name: ID - select Type: Character - enter Width: 5 - select dialog button, Set - select dialog button, Ok - select dialog button, Yes - select dialog button, Ok A database has just been created named NAMES.DBF with the following format: Field Name Type Length NAME Character 20 ADDR " 30 CITY " 15 STATE " 2 ZIP " 5 6. Select and Browse a Database To select a database for browsing , select menu item Select, select menu item DataBases, then click on the down arrow key. This will list all the databases in the default directory. Select the databases you wish to browse, then select the dialog button Ok to browse the database that was selected, select menu item File, select the menu item Run. The database browse window will now appear. (For an explanation on why a database is Run please refer to section 3, Page 1) Example: Select and browse a database named NAMES.DBF - select menu item Select - select menu item DataBases - click on the dialog down arrow key - select NAMES.DBF from the list - select dialog button Ok - select menu item File - select menu item Run A browse window will now be displayed. 7. Enter Records To enter records into a database, a database must have been created, selected and run (see sections 5 and 6). To enter a new record select menu item Edit, then select menu item New Record. A default dialog box is automatically created for every database used in Dossier for Windows (These dialog boxes can be modified by the user). Enter data into the field edit boxes, then select the dialog button Ok to save the data and exit, or the dialog button Cancel to exit without saving. Example: Enter records into a database named NAMES.DBF - select menu item Edit - select menu item New Records - enter Name: SMITH Addr: 2121 N Green St. City: Delaware State: DL Zip: 22222 Id: 300 - select dialog button Ok To view the newly entered record, - select menu item Search, select Top. - select menu item Edit - select menu item New Records - enter Name: JONES Addr: 222 S Red Ave. City: Philadelphia State: PA Zip: 22442 Id: 100 - select dialog button Ok - select menu item Edit - select menu item New Records enter Name: QUINN Addr: 2121 N 34 St. City: New York State: NY Zip: 22211 Id: 200 - select dialog button Ok 8. Edit Records To edit a record, highlight the record you wish to edit by using the arrow keys, then press or, or by clicking on the record with the right mouse button . A default edit dialog box will appear. Edit the required fields, then select the dialog button Ok to save any changes or Cancel to exit without saving changes. Example: Edit a record in the database named NAMES.DBF - double click on a record with the right mouse button th - change the name to WASHINGTON - select dialog button Ok 9. Delete a Record To delete a record, highlight the record you wish to delete by using the arrow keys or by a single click of the the right mouse button. Select the menu item Edit, select the menu item Delete Record, this will place an asterisk at the beginning of the record and mark the record as deleted but will not remove the record from the database. To permanently remove the record, select the menu item File, select the menu item Pack. 10. Create an Index file To create an index file, select menu item Select, select menu item DataBases, select dialog button Index. This will bring up an Index Definition dialog box, enter an index file name and expression. Then select Ok. Example: Create an index file named NAMES.NTX - select menu item Select - select menu item DataBases - select dialog button Index - enter Index: NAMES - enter Key Expr: NAME+ID - select dialog button Ok - select dialog button Ok An index file named NAMES.NTX has been created, indexed on the primary field NAME and on the secondary field ID 11. Set a Relation First, two databases must exist, indexed on a common field. Select menu item Select, select menu item DataBases, select dialog button Relations. A Relation Definition dialog box will appear with the name of the primary database listed. Enter the name of the common field in the Expression edit box, enter the name of the database you wish to set a relation to, and select the dialog button Ok. Example: Create a database named DATES.DBF an index file named DATES.NTX. Then set a relation to it from NAMES.DBF and the index file NAMES.NTX - select menu item Utilities - select menu item Create/Modify DataBase - move the mouse pointer under "NAMES", in the list box and click, this will clear the edit boxes and allow you to create a new database - enter DATES.DBF - select dialog button, Ok - select dialog button, YES - enter Field Name: ID - select Type: Character - enter Width: 5 - select dialog button, Set - enter Field Name: B_DATE - select Type: Date - select dialog button Set - enter Field Name: SENT_P - select Type: Logical - select dialog button, Set - enter Field Name: COST - select Type: Numeric - enter Width: 9 - enter Decs.: 2 - select dialog button, Set - select dialog button, Ok - select dialog button, Yes - select dialog button, Ok A database has just been created named DATES.DBF with the following format: Field Name Type Length ID Character 5 B_DATE Date 8 SENT_P Logical 1 COST Numeric 9,2 - select menu item Select - select menu item DataBases- move the mouse pointer under NAMES in the list box and click, this will clear the edit boxes and allow the user to select another database - click on dialog down arrow key - select DATES.DBF from the list - select dialog button, Ok - select menu item Edit - select menu item New Records - enter Id: 300 B_date: 02/02/60. Sent_p: mark the box with an X by clicking on it with the mouse Cost: 40.00 - select dialog button Ok . - select menu item Edit - select menu item New Records - enter Id: 100 B_date: 02/12/64. Sent_p: do not mark the box Cost: 50.00 - select dialog button Ok - select menu item Edit - select menu item New Records enter Id: 200 B_date: 02/12/70 Sent_p: do not mark the box Cost: 25.00 - select dialog button Ok - select dialog button Ok - select menu item Edit - select menu item New Records enter Id: 200 B_date: 02/12/70 Sent_p: do not mark the box Cost: 25.00 - select dialog button Ok - select menu item Select - select menu item DataBases - select dialog button Index - enter Index: DATES - enter Key Expr: ID - select dialog button Ok - select dialog button Ok An index file named DATES.NTX has been created, indexed on the primary field ID. - activate the browse window that contains the NAMES.DBF database - select menu item Select - select menu item DataBases - select dialog button Relations - enter in the Expression edit box ID - click on dialog down arrow key - select DATES from the list - select dialog button, Ok - select dialog button, Ok A relation is now set between the database NAMES, into the databases DATES, on the field ID. If you move from record to record in the NAMES database there will be a corresponding move in the DATES database to the record with the same ID 12. Programming Reference Dossier for Windows¦ language may be attached to a dialog box, dialog button or run seperately. It may also be used anywhere expressions are needed. The basic structure of the language is, the block design. For example: {; ; ...; ;} If the braces are omitted, only will be executed while the other expressions are considered comments. Dossier for Windows supports the following types of variables: Numeric Fixed point variables Real Floating point variables saved in 8 bytes Strings Chains of characters up to 32K in memory variables and 255 bytes in data bases Date Dates Boolean Logical variables that assumes the value TRUE or FALSE Memo Variable type fields that may contain up to 32K sized text The Dossier for Windows language contains the following operators: Arithmetic a + b Sums a and b a - b Subtracts b from a a * b a multiplies b a / b a divided by b a % b remainder of division of a by b a ^ b a power b ++a increments a by 1 --a decrements a by 1 Assignment a := a receives the result of the expression Logical a and b true if a and b are true a or b true if either a or be are true not a true if a is false Comparison a > b true if a is greater than b a < b true if a is less than b a >= b true if a is greater than or equal to b a <= b true if a is less than or equal to b a b true if a is not equal than b a != b true if a is not equal than b a = b true if a is equal to b a == b true if a is equal to b String Manipulators a $ b true if a is found in b Control Flow Statements: IF if( ) ; [ else ; ] Example: if( value > 1000 ) "Expensive"; else "Cheap"; If value is greater than 1000, the result of the expression will be "Expensive", else it will be "Cheap". If it is necessary to put more than one expression in the or , put them between braces { ... }. FOR for( [, , ..., ]; ; [, , ..., ] ) ; a) All expression are executed; b) is executed, if the result is true is executed, on the contrary the for command ends and the nextexpression after the for is executed; c) All the expressions are executed; d) goes back to b; Example: for( i := 1, j := len( vector ); i <= len( vector ); ++i, --j ) { swap := vector[i]; vector[i] := vector[j]; vector[j] := swap; } WHILE while( ) ; a) While the is true, the is executed, if the becomes false the while command terminates and the next expression after the while is executed. Example: while( !eof( ) ) print_record( ); BREAK This command is used inside the for and while commands to terminate the control loop unconditionally. Example: while( !eof( ) ) if( !paborted( ) ) print_record( ); else break; CONTINUE This command is used inside the for and while commands to go directly to the next expression in the for and while commands Example: for( i := 1; i <= len( vector ); ++i ) { if( vector[i] < 10 ) continue; vector[i] := mod( vector[i], 10 ); } LOCAL This language command permits the creation of local variables meaning, they will only be visible inside the block which they are declared. All functions called inside the block will also have access to these local variables. local( [, , ..., ] ); Example: { local( i ); for( i := 0, top( ); !eof( ); skip( 1 ) ) if( deleted( ) ) ++i; error( "The file contains "+ltrim(str(i))+ "deleted records" ); } RETURN return( ); This command is used to end the execution of a function or expression. Then return to the point immedately following the function or expression, with a value. Example: if( value > 100 ) return( "Expensive" ); else return( "Cheap" ); Note: If the return statement is the last expression in a block, it may be omitted. if( value > 100 ) "Expensive"; else "Cheap"; FUNCTION function ( [ [, ..., ] ) This command allows for the creation of local functions inside an expression. Example: { function factorial( n ) { if( n <= 1 ) return( 1 ); else return(n*factorial( n-1)); } Error( "The factorial of 5 is"+ ltrim(str(fatorial( 5 ) ) ) ); } PARAMETER parameter( [, ..., ] ) This command is used to define global function parameters (defined in Function, in the Select menu pulldown). Example: Function Name: ToUpper Expression: { parameter( text ); return( upper( text ) ); } 13. Dossier for Windows Language Functions num_var := abs( num_var ) Returns the absolute value of . array_var := array( var1, var2, ..., varn ) Returns an array containing the parameters. num_var := asc( string_var ) Returns the numeric value of the first character in. num_var := at( string_var1, string_var2 ) Finds the first occurrence of in and returns its offset. BlankRecord( ) Prepares the current database to create a new record. Bof( ) Returns TRUE if the top of file has been reached. Bottom( ) Goes to the last record of current database. num_var := Button( id ) Returns the state of the button : 0 -> unchecked 1 -> checked 2 -> grayed. Button( id, num_var ) Modifies the state of the button : 0 -> uncheck 1 -> check 2 -> gray. array_var := cells( nelements ) Returns an array with empty cells. string_var := cfield( nfield ) Returns the name of the field . string_var := chr( num_var ) Returns the corresponding ASCII character. string_var := cmonth( num_var ) Returns the month in string format. num_var := Count( area [, string_condition ] ) Returns the number of records from the database in area . CreateVar( string_var ) Creates a variable with name informed in . Ex: CreateVar( µmyvar¦ ); date_var := ctod( string_var ) Converts a string variable to date format. Ex: war := ctod( ¦01/16/91' ) num_var := cton( string_var ) Converts an edited string to numeric. date_var := date( ) Returns the current date. num_var := day( date_var ) Returns the day of . DeleteRecord( ) Deletes the current record in the current database. DeleteVar( string_var ) Deletes variable with name informed in . Ex: DeleteVar( µmyvar¦ ); var := descend( var ) Inverts the sign of numeric values or inverts the bits of strings. This function does not support DATE type variable. bool_var := Dialog( "dialog_name" ) Pops up the dialog and returns TRUE if the button was clicked or FALSE otherwise. string_var := dtoc( date_var ) Converts a date to string in the format XX/XX/XX. string_var := dtos( date_var ) Converts a date to string in the format YYYYMMDD. EndDialog(true or false ) Ends the current dialog box.(True condition, False ) Eof( [area] ) Returns TRUE if the bottom of file has been reached. Erase( filename ) Deletes the file informed in . Returns TRUE if the file has been deleted successfully. Error( "string_var" ) Pops up a message box containing . FieldCount( ) Returns the number of fields in the current database. bool_var := file( string_var ) Returns TRUE if the file named exists. string_var := firstup( string_var ) Returns in lowercase format except first letter. goto( n ) Goes to record . var := iif( var1, var2, var3 ) Returns if is true otherwise returns . Index( index_name, key_expression ) Build an index file. InitControls( ) Reinitializes the controls in the current dialog box. InsertRecord( ) Creates a new record in the current database. num_var := int( num_var ) Returns the integer part of . LastField( ) Returns the number of fields in the current database. LastRec( ) Returns the number of records in the current database. string_var2 := left( string_var1, length ) Returns the first characters of . int_var := len( string_var ) Returns the length of a string variable or the number of elements in a vector. num_var := log( num_var ) Returns the logarithm number of . string_var := lower( string_var ) Converts to lowercase. string_var := ltrim( string_var ) Strip blanks on the left side of . var := max( var1, var2 ) Returns the maximum value of and . var :=min( var1, var2 ) Returns the minimum value of and . num_var := mod( num_var1, num_var2 ) Returns the remainder value of /. num_var := mod( num_var1, num_var2 ) Returns the remainder value of /. num_var := month( date_var ) Returns the month of . string_var := ntoc( num_var [, length [, decs ] ] ) Converts a numeric variable to edited string. string_var := ntos( num_var [, length [, decs ] ] ) Converts a numeric variable to a sorted string. This function is suitable for indexing files by strings and numeric fields in the same expression. bool_var := PAborted( ) Returns TRUE if the report was aborted. Pack( ) Packs the current database. PackMemo( ) Packs the memo file of the current database. PClose( ) Closes the printer spooler. num_var := PCol( ) Returns the current printing column (in pixels). cfont := PCreateFont( FontName, PointSize, bBold, bItalic, bUnderline ) Creates a font. PDeleteFont( cfont ) Deletes the font created by the PCreateFont function. PDrawLine( X1, Y1, X2, Y2, penStyle, penWidth ) Draws a line with defined style and width. PDrawText( col, Text, align, width [, cfont ] ) Prints at column , aligning eft, ight or enter, with width and font . PEject( ) Ejects printer one page. num_var :=PFontHeight( [cfont] ) Returns the height (in pixels) of the font or default printer font, num_var := PFontWidth( [cfont] ) Returns the width (in pixels) of the font or default printer font. num_var := PHeight( ) Returns the printable page height. bool_var := POpen( Title, HeadingFunction, nWidth ) Opens the printer spooler and returns TRUE or FALSE. num_var := PLin( ) Returns the current printing line (in pixels). Protect( id, bool_var ) Protects or unprotects the control depending on the value of .PSkip( height ) Skips down . PText( col, Text [, cfont ] ) Prints at column with font . num_var := PWidth( ) Returns the printable page width. var := Read( id, type ) Reads the control and returns its value with format . RecallRecord( ) Recalls the current record in the current database. RecCount( ) Returns the number of records in the current database. RecNo( ) Returns the record number of the current database. Reindex( ) Rebuilds the indexes of the current database. string_var := Replicate( string_var, qtty ) Returns a string with characters . Report( report_name ) Executes the report . string_var2 := right( string_var1, length ) Returns the last characters of . string_var := rtrim( string_var ) Strip blanks on the right side of . recno := SearchKey( [ area, ] ndxno, key_value ) Searches the key informed in in the index number of the current database or the database in the area . Seek( [area, ] key ) Seeks the key in the area or current area (if is omitted). num_var2 := select( [ num_var1 ] ) Selects the area and returns the previous area number. If is omitted this function returns the current area, or if num_var is equal -1 returns next free area. SendKey( value ) Sends one of the following messages to the current window, depending on : 1: Top, 2: Bottom, 3: Line Up, 4: Line Down, 5: PgUp, 6: PgDn, 7: Edit Record, 8: New Record. SetPFontHeight( [cfont, ] newHeight ) Sets a new height for the font or default printer font. SetPX( X ) Sets the current printer position. SetPY( Y ) Sets the current printer position. SetRange( area, string_key1, string_key2 ) Limits the view of the database in area by setting the range between and . SetRelation( string_var, area ) Sets a relation between the current area and the area informed in . The variable has the expression to be used. Skip( n ) Skip records forward (if positive) or backward (if negative) the current database. string_var := space( num_var ) Creates a string with blank characters. num_var := sqrt( num_var ) Returns the square root of . Status( string_msg ) Writes a string into the Status window. string_var := str( num_var [, length [, decs ] ] ) Converts a numeric variable to string.This function is to keep dBASE/Clipper compatibility. string_var := substr( string_var, offset [, length ] ) Returns a substring of a string variable, starting at of size . num_var := sum( num_field [, string_condition ] ) Returns the sum of the field .Ex: Value := sum(Client->Limit ). num_var := SumFields( field1, field2 ) Returns the total from to in the current record. string_var := Time( [dummy] ) Returns current time. Top( ) Goes to the first record of current database. Total( totalname ) Executes the total . string_var := trim( string_var ) Strip blanks on the right side of . UpdateRecord( ) Updates the current record in the current database. string_var := Upper( string_var ) Converts to uppercase. Use( ) Use( file ) Use( file, alias ) Use( file, alias,indexes) Opens a Database and, its indexes (if informed). UseIndex( [ indexes ] ) Close the indexes and, if informed, opens others. num_var := val( string_var ) Converts a string variable to numeric. This function is to keep dBASE/Clipper compatibility. Write( id, value ) Sends to the control . num_var := year( date_var ) Returns the year of .. Pops up a message box containing and returns TRUE if the button is clicked. Zap( ) Eliminates all records of the current database. 14. Using the Dialog Box Editor To use the dialog box, editor select a database, then run it or open an existing .DPR file This will display a browse window. Then select the menu item Select, select the submenu item Dialogs. At this point the user may elect to create a New dialog or to View an existing dialog. New Allows the user to create a new dialog box. View Allows the user to edit all dialog boxes attached to the database. (To see the same View box move the mouse pointer to the active database and double click on the window with the right mouse button). The user may position the mouse pointer on any of the controls, edit boxes, text boxes or the actual dialog box and double click with the right mouse button. This will bring up various dialog definition boxes depending on the type of control the mouse pointer was click on. These dialog definition boxes are where the user can attach programming language code to dialog boxes and controls . Example: Create a push button, attach a message box to the button - select a database and run it( for this example we will use NAMES.DBF refer to section 3 page 3) - select menu item Select - select submenu item Dialogs - select submenu item View - select dialog NAMES1 - select menu item Select - select submenu item Dialogs - select submenu item Controls - select submenu item Push Button At this point, a push button dialog item has been selected and must be placed on the dialog box. With the mouse, position the cross over a blank area on the dialog box and click once with the right mouse button. - double click on "Button" that was just placed - a button control definitions dialog box will appear - set the focus to the "Validations:" edit box and either press F5 or click once with the right mouse button. This will bring up the Expression Constructor dialog box - enter the following: { error("Hello World"); } - edit the edit box where "Button" is displayed by typing in "Hello" - select dialog button Ok- select main menu item Select - select submenu item Dialogs - select submenu item End Editing or position the mouse pointer over the dialog box and double click with the right mouse button - select dialog button Yes - select a record to edit by positioning the mouse pointer over a record and double clicking the right mouse button - select dialog button Hello (now a modal message box will appear with the message "Hello World") - select dialog button Ok To see a varied assortment of dialog boxes and programming code attached to dialogs, open the BILLS.DPR file and view the various dialog boxes. 15. User Defined Functions (UDF) NOTE: To take full advantage of UDF¦s the user must have an understanding of basic programming techniques. To create, edit or view a UDF, select menu item Select, select menu item Function. This will bring up a Functions dialog. The user then enters the function name, sets the focus to the Expressions edit box and presses F5 or clicks the right mouse button once. An Expression Constructor dialog box will appear. Here is where the programming code is entered. Select Ok to save the entered data, then select the dialog button Set (Note: "Set" must always be selected to save the data entered). An example of a function is provided in the TEST2.DPR. - A function can be run seperately by selecting menu item File, menu item Run Function (Note: when the function is created it must be marked as a function to be run by X¦ing the µFunction to be run check box¦). This will allow you to run the function from the main menu. (see TEST2.DPR) - A function can be called from a dialog. See BILLS.DPR, view the dialog BILLDATE, double click on the dialog box and examine the programming code attached to the Post Scriptum Expression. The function PrintBill is being called. To view this function select the menu item Select, then select the Functions. If you have any questions please feel free to call: 1 (800) 477-7147 for assistance.