100% found this document useful (2 votes)
293 views

Foxpro Commands and Functions PDF

Uploaded by

z. e.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (2 votes)
293 views

Foxpro Commands and Functions PDF

Uploaded by

z. e.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 1083
Commands & Functions Includes Examples Fox Software Overview of the Documentation Getting Started introduces you to FoxPro and gives you a quick tour of its powerful features. After the quick tour, you can continue to the tutorial and learn how easy it is to use the features previewed in the quick tour. Interface Guide begins with an introduction to the interface followed by an item-by-item tour of the interface. Each menu option is described along with any related dialogs and windows. FoxPro power tools, which allow you to build interface components and access your data without programming, are also described in this manual. Commands & Functions is a complete reference for the FoxPro Programming language. It contains detailed descriptions of all FoxPro commands and functions in alphabetical order, plus an alphabetical listing of system memory variables. Developer's Guide contains an extended discussion of recommended techniques for designing and implementing FoxPro 2.0 applications. Suggested usage of new FoxPro 2.0 power tools is illustrated by numerous examples. Advanced. topics such as customization, compatibility and optimization are also included in this manual. Help is always a keystroke away when you use FoxPro. To see context-sensitive help for the active window, dialog or menu option, press Fl. For a command, function or system memory variable, select it and press Fl. Each help topic is linked with related help topics for easy access, FoxPro’ Commands & Functions ‘August 191 Fox Software, Inc. 134 W. South Boundary Perrysburg, Ohio 43551 Trademarks FoxBASE®, FoxBASE"+ and FoxBASE®+/Mac are registered trademarks and FoxPro™ is a trademark of Fox Holdings, Inc. Other trademarks may be used throughout this manual. FoxPro software and reference materials are the sole property of Fox Holdings, Ine. Reproductions of any kind without prior written consent is strictly prohibited. © 1989, 1991 Fox Holdings, Inc. All rights reserved. Contents Contents The FoxPro Language Using the FoxPro Language ‘The Command Window . Creating Programs . . . Saving Programs .. . . Modifying Programs Executing Programs nee Additional Program Information . . . FoxPro’s On-line Help Facility . . . . Understanding the Language . Commands and Functions Command and Function Syntax Conventions . . Expressions ........ Additional Abbreviations . Record Range: Scope, For and While . Database Work Areas . Functions and Memo Fields... . . . Typographic Conventions... ........ Commands and Functions iad sean Data Types... . .: Character Functions . . . Numeric Functions . . . . Date and Time Functions Data Conversion Databases . aoe Field Manipulation . . . . Database Manipulation Record Manipulation .. . . Indexes Relations 2-12 2-13 2-14 Programming ..........0..005 oe Debugging and Error Handling ....... Program Execution Structured Programming Low-Level File Functions ... . . Memory Variable Manipulation Array Manipulation . oe Event Handlers Input and Output... . . Data Formatting Printing Meau Bars and Popups Windows ‘Typing, Keyboard and Mouse Reports and Labels FoxPro Environment . . . Environment... . . File Management Network (FoxPro/LAN) Network Commands and Functions. Commands and Functions This chapter contains complete descriptions of the FoxPro commands and functions. The chapter is organized alphabetically and begins on page 3-1. System Memory Variables ‘This chapter contains complete descriptions of the FoxPro system memory variables. The chapter is organized alphabetically and begins on page 4-1. Index 215 2-15 .. 216 .. 217 « . 2-18 +. 219 220 2. B21 « . 222 2 B22 «225 + 226 «228 » » 230 .. 231 » » 232 ~ . 232 . . 237 . 2-39 2-39 Contents 1 The FoxPro Language SS SS ae a MTN TE SETS FoxPro is a product developed for data management — the catalog- ing, tracking and processing of information. Although you can per- form many database operations non-procedurally through the menu system and interface, accessing FoxPro's tremendous power requires some knowledge of the FoxPro programming language. This chapter contains a variety of topics that will help you use the FoxPro programming language, including an explanation of the conventions used to describe the syntax of FoxPro commands and functions. FoxPro has an elegant user interface that makes data manage- ment easy. While you use the interface, FoxPro commands that correspond to your actions are generated in the Command window. ‘The Command window provides a gateway between the interface and the FoxPro language. The Command window contains a history of all the commands created during an interactive FoxPro session, providing a means to learn the FoxPro language. By examining the commands that are generated when you use the interface, you can quickly learn the language. A command generated in the Command window can be re-executed by moving the cursor to the line containing the command and pressing Enter. After a long interactive FoxPro session, a lengthy list of FoxPro commands is generated in the Command window. You can copy and paste these commands into a FoxPro program. A program can be repeatedly run, making it easy to execute literal- ly thousands of commands again and again. FoxPro programs, composed of FoxPro commands, provide in- credible power to manipulate data. Access to the full power of FoxPro is provided by the FoxPro language. The FoxPro Language Chl Using the FoxPro Language Using the FoxPro Language c12 The Command Window A FoxPro command can be directly executed by typing it into the Command window and pressing Enter. To re-execute a command, move the cursor to the line containing the command with the arrow keys or the mouse and press Enter. Since the Command window is a special text editing window, you can edit commands using FoxPro’s extensive editing tools. You can edit, insert, delete, cut, copy or paste text within the Command window. For further information on the Command window, see the Window Menu chapter in the FoxPro Interface Guide. Creating Programs A FoxPro program allows you to execute a series of commands you enter into the program file. Running a program has many advantages over ontering single commands in the Command window: * A> program allows you to execute many commands automatically, saving time and lots of typing. * The program can be modified and run again. * Programs can run other programs, * Certain structured programming commands are available only in programs. * FoxPro programs provide unparalleled performance. FoxPro programs are text files containing a series of commands. You can create a program in FoxPro in one of these ways: * Choose New... from the File menu popup. The New File dialog appears. Choose the Program radio button, then choose OK. * In the Command window, type the command MODIFY COMMAND. ‘The FoxPro Language Using the FoxPro Language A new window named UNTITLED.PRG is opened. You can now enter your program into this window. The program editing win- dow supports all the standard FoxPro editing features. For help on the FoxPro text editing features while in a text editing window, press Fl. If you have used FoxPro interactively and would like to save the commands generated in the Command window, you can ) copy and paste them directly into the program editing win- | dow. Program examples from the help file can also be copied and pasted directly into a program. Copying program examples from the help file is a quick and easy way to learn how FoxPro commands and functions work. Saving Programs After you create your program, be sure to save it. To save your untitled program, choose Save... or Save AS... from the File menu popup. The Save As dialog appears, Once you save your program you can execute the program or further modify it. Modifying Programs ‘After you save your program, you can modify it. You must first open the program. You can open a program in FoxPro in one of these ways: * Choose Open... from the File menu popup. A dialog appears with a list of available files. From the Type popup, choose the Program option. Choose the program you want to modify, then choose OK. * In the Command window, type the command MODIFY COMMAND followed by a space and the name of the program to modify, then press Enter. The program is opened for editing. For example, to modify a program named MYPROGRM, enter this command in the Command window: MODIFY COMMAND myprogrm After you open the program you can make changes. When you finish making your changes, be sure to save the program. The FoxPro Language C1-3 Using the FoxPro Language C1-4 Executing Programs After you create a program, the program can be executed. To ex- ecute a program you can: * Choose the Do... option from the Program menu popup. From the program list, choose the program to execute, then choose OK. * Type the command DO followed by a space and the name of the program to execute, then press Enter. For example, to execute the program named MYPROGRM, enter this command in the Command window: DO myprogem Additional Program Information For complete information on creating, editing and saving program files, see the Text Editor section of the Interface Basics chapter in the FoxPro Interface Guide. ‘Text editing features are also described in the ™ Text Editing topic in the FoxPro on-line help facility. For information on executing program files, see the Program Menu chapter in the FoxPro Interface Guide, the ® Do topic in the FoxPro on-line help facility, or the DO command in this manual. FoxPro’s On-line Help Facility An on-line help facility is always available in FoxPro. ‘The on-line help facility contains specific information on every FoxPro com- mand, function and system memory variable and general informa- tion about FoxPro. Context-sensitive help for the FoxPro interface is also available. ‘To access on-line help, press F1 or choose the Help... option from the System menu popup. The Help window is displayed with an extensive list of topics. Choose a topic in the Help window for details on the topic, You can get help on related topics in the help facility by choosing an option from the See Also popup. You can also sclect text in a help topic and choose the Look Up push button. This allows you to get help for a command or function by selecting the command or function as it appears in a topic and choosing Look Up. ‘The FoxPro Language Using the FoxPro Language If the text you select is a help topic, help information appears for the topic. Ifa help topic does not correspond to the text you select, a dialog is displayed containing a list of help topics. The nearest matching topic is selected. You can choose this topic or another topic from the list. To get help for a command or funetion in the Command window or a program, select the command or function and press FL Context-sensitive help is available for FoxPro system windows, dialogs and system menu options. Press F1 when a system win- dow or dialog is frontmost. For further information on FoxPro's on-line help facility, see the ‘System Menu chapter in the FoxPro Interface Guide. The FoxPro Language C15 Understanding the Language Understanding the Language C16 Commands and Functions The FoxPro language consists of two elements — commands and functions. A command performs an action, a function returns a value. For example, the BROWSE command lets you look at the contents of a database. The DATE( ) function returns the system date from your computer. Functions contain a pair of parentheses that distinguish them from commands. Commands and functions can be combined together to create a FoxPro statement. Functions are not used by themselves, but are always combined with a FoxPro command. For example, the question mark (?) is a command that sends out- put to the screen. DATE ) is a function that returns the current system date. They can be combined to output the system date to the sereen: 2 DATE( ) The STORE command assigns a value to a memory variable. In this example, the TIME() function returns the current system time, and this value is placed in the memory variable BEGINTIME: STORE TIME( ) TO begintime Command and Function Syntax Conventions FoxPro commands and functions consist of one or more com- ponents. These components determine how a command or function can be used Let’s look at the syntax of a typical FoxPro command. The REPLACE command is used to update fields in a database record. Here’s the syntax for the REPLACE command: REPLACE WITH [ADDITIVE] [, WITH [ADDITIVE] ... [] [FOR ] [WHILE ] [NOOPTIMIZE] ‘The FoxPro Language Understanding the Language ‘The following table lists the components of the REPLACE command. Component Examples in the REPLACE Command REPLACE, WITH, ADDITIVE, FOR, WHILE, NOOPTIMIZE Expressions | exprl, expr2, expL1, expL2 field1, field2 ‘This manual uses special typographic conventions in command and function syntax. These conventions indicate whether a command or function component should be entered as shown or supplied by you, whether it is required or optional, and so on. UPPER- UPPERCASE designates a FoxPro keyword. Every CASE FoxPro command and function contains at least one keyword. FoxPro uses keywords to identify a com- mand or function. Keywords are sometimes called reserved words since FoxPro reserves these special words for internal use. Some examples of keywords in the REPLACE command are REPLACE (which FoxPro identifies as a command), WITH, ADDITIVE, FOR and WHILE. WITH, ADDITIVE, FOR and WHILE are referred to as clauses. A keyword can be abbreviated to the first four charac- ters. <> Angle brackets < > surrounding lower-case text indi- cate information that you must provide. This infor- mation could be a file name, an expression, a memory variable name and so on. You replace the text and angle brackets with the appropriate name or expres- sion. () Parentheses must, be included in all FoxPro functions. Include the parentheses as they appear in the function's syntax. The FoxPro Language 1-7 Understanding the Language C18 Expressions Square brackets indicate a portion of a FoxPro com- mand or function that’s optional. Do not type them. For example, the REPLACE command supports numerous options, and you have the choice of includ- ing these options. The ADDITIVE, , FOR , WHILE and NOOPTIMIZE clauses and keywords are placed in square brackets to indi- cate they are optional. A vertical bar separating options indicates that you can enter only one of the options. An ellipsis indicates that a command or function or a portion of a command or function can be continued in a similar fashion. For example, the INLIST() function supports a large number of arguments, The ellipsis in the INLIST( ) syntax indicates that you can include more arguments than the three listed. A FoxPro expression is a combination of database field values, functions, memory variable values, array element values, constants and operators. There are four types of FoxPro expressions — char- acter, numeric, date and logical. Expressions are denoted in FoxPro commands and functions this way: Expression Expression type | Character, Numeric, Date or Logical | List of expressions separated by commas The FoxPro Language Understanding the Language When more than one expression of the same type appears in a command or function, a number is added to indicate its position in the command or function. For example, the syntax for the CHRTRAN( ) function is: CHRTRAN(, , ) CHRTRAN( ) requires three character expression arguments, , and . ‘The database fields, functions, memory variables and array ele- ments that are combined to create an expression must be of the same data type. If they are of different type, FoxPro generates an “Operator/operand type mismatch” error message. Character Expressions Character expressions are composed of the following: * Character type database fields * Functions that return character values * Memory variables and array elements that contain character data * Character type constants, called string literals A string literal is a character string surrounded by single or double quotation mark. For example, ‘Ohio’ or “Ohio”. The quotation marks must match. That is, you cannot begin a character string with a single quotation mark and end it with a double quotation mark. You can imbed a quotation mark in a character string by sur- rounding the character string with quotation marks of the opposite type. For example, “Don’t touch!” is a legitimate string literal. ~ Throughout the FoxPro documentation you will see the null \? string mentioned. The null string is a character string of eg length 0 — it contains no characters. The null string can be expressed with a pair of quotation marks with no space between them —” or” ‘The FoxPro Language C19 Understanding the Language C110 Character Expression Operators [operator | ————— ‘The FoxPro Language Name to Include File name Database field name | List of database field names |_ Memory variable array name Memory variable or array element name List of memory variable names Menu name |_Menu pad name _ Popup name | List of popup 1 Window name List of window names C1-13 Understanding the Language C1-14 When including a list of names, the names must be separated by commas. The REPLACE command we're using as an example requires that you include at least one name, field1, a database field name. A name is not an expression, a memory variable or array element or a database field. A name should not be surrounded by quota- tion marks, Name Expressions Although a name cannot be a memory variable or an array ele- ment, you can create a name expression that substitutes the value of a character type memory variable or array element as the name. Name expressions provide flexibility in FoxPro commands and functions. Store the name to the memory variable (or array element). The name can then be substituted into a command or function by enclosing the memory variable in parentheses. For example, the REPLACE command requires a database field name. You can store a database field name to a memory variable and use a name expression in REPLACE where the field name oc- curs: STORE ‘city! TO marcity REPLACE (avarcity) WITH ‘Perrysburg’ Here the database field name CITY is stored to the memory vari- able MVARCITY. The name expression (mvarcity) replaces the field name in REPLACE. A similar process called macro substitution allows memory vari- ables to replace names. Macro substitution places an ampersand (&) before the memory variable to tell FoxPro to use the value of the memory variable as a name. A command or function contain- ing a name expression executes faster than one containing macro substitution — always use a name expression instead of macro substitution. The FoxPro Language Understanding the Language Additional Abbreviations The following table contains terms and abbreviations commonly used in the description of FoxPro commands and functions. Abbreviation border string column command delimiter macro name memo field parm list path ‘The FoxPro Language Work area alins Array name Border definition string ‘Screen or window column FoxPro command Separation character Directory Disk drive name Function eode Index expression Set of expressions, fields, . Keyboard macro name Memo field name Menu pad name List of parameters Disk directory specification Serial or parallel output port name Procedure file name Screen or window row C115 Understanding the Language Range of database records skel File specification skeleton statements Set of FoxPro commands text lines Text that is not a FoxPro command topic Subject in FoxPro Help file Memory variable, array element or database field work area Database work area Record Range: Scope, For and While When a command operates on records in a database, you can typi- cally specify a range of records that the command affects. You specify the record range using scope, FOR and WHILE clauses. Scope When a scope is included, the command acts on a specific range of records in the database. You can include one of the following clauses to specify a record range: ALL The command acts on all records in the database. NEXT ‘The command acts on a range of records beginning with the cur- rent record and continuing for the specified number of records. NEXT 1 acts on the current, record. RECORD The command acts on the specified database record number , C1-16 ‘The FoxPro Language Understanding the Language REST The command acts on a range of records beginning with the cur- rent record and ending with the last record in the file. FOR ‘The record range of a command can also be specified using FOR and WHILE clauses. When a FOR clause is used, each record that meets the specified logical condition is affected by the command. Rushmore Technology and FOR Clauses ‘The Rushmore technology is a basic patent-pending data access technique that permits sets of records to be accessed very efficient- ly, at speeds comparable to single-record indexed access. Using Rushmore, some complex database operations run hundreds or even thousands of times faster than before, FoxPro 2.0 enables personal computers to handle truly gigantic databases, containing millions of records, at speeds comparable to mainframe database systems. In its simplest form, Rushmore speeds up single-database com- mands utilizing FOR clauses that specify sets of records in terms of existing indexes. You can take advantage of Rushmore anywhere that a FOR clause appears. Rushmore is designed so that its speed is proportional to the number of records retrieved. Potentially Optimizable Commands With FOR Clauses AVERAGE couNT JOIN REPORT BROWSE DELETE LABEL SCAN CALCULATE DISPLAY LIST SORT CHANGE EDIT LOCATE SUM COPY TO EXPORT RECALL TOTAL COPY TO ARRAY INDEX REPLACE, ‘The FoxPro Language CLT Understanding the Language C1-18 The data retrieval optimization that Rushmore provides is depend- ent on the FOR clause expression. The FOR clause expression may be simple or complex, and data retrieval speeds can be enhanced by including an optimizable FOR expression. Optimizable expressions can be combined with the AND, OR and NOT logical operators to form a complex FOR clause expression. When basic expressions are combined into a complex expression, the resulting expression may also be optimizable. A basic optimizable expression takes one of the following forms: or In a basic optimizable expression: * must exaetly match the expression on which an index is constructed and must not contain aliases * must be one of the following: <, >, =, <5>5, <5, 8, [5 ean be any expression, including memory variables and fields from unrelated databases For example, if you have indexes on the following expressions: custno UPPER (lastname) hiredate add then the following are basic optimizable expressions: "Pred? custno >= 1000 UPPER (lastname) = / Miri hiredate < {12/30/90} If you issue the command STORE ‘WASHINGTON AVENUE’ TO X The FoxPro Language Understanding the Language then the following are also basic optimizable expressions: addr addr x SUBSTR (X, 8, 3) For additional information on Rushmore, see the Optimizing Your Application chapter in theFoxPro Developer's Guide. WHILE ‘The WHILE expression, on the other hand, causes the command to act on each database record only as long as the logical expression evaluates to true. The first time the expression evaluates to false, the command ceases without considering any remaining database records. This expression is typically used with a database that’s been sorted or indexed on the field(s) used within the WHILE ex- pression. Scope, FOR and WHILE expressions can all be used in the same FoxPro command, When FOR and WHILE are both specified, the WHILE expression takes precedence. Database Work Areas FoxPro allows you to open and manipulate database files in 25 work areas. Work areas can be identified with the letters A through J for the first 10 works areas, the numbers 1 — 25 or by the database alias if a database is open in a work area. ‘To open a database file in a work area other than the current work area, you must, specify or select the work area, When a database is opened, it is given an alias by which it can be identified. Unless you specify otherwise, the database alias is the name of the database file (excluding the DBF extension). Default Alias If you open the database named CUSTOMER DBF in work area A with the commands: SELECT A USE custaner the database alias CUSTOMER is automatically assigned. The alias can then be used to identify the database in a command or fune- tion. The FoxPro Language C119 Understanding the Language 1-20 User-Assigned Alias ‘You can assign an alias to a database when you open a database. You can open CUSTOMERDBF (in work area A) and assign the database an alias of PEOPLE with the command: SELECT A Us tomer ALIAS people The alias PEOPLE can then be used to refer to the database. (For complete information on assigning database aliases, see the USE command.) FoxPro Assigned Alias There are instances where FoxPro will automatically assign a database alias. If a single database is opened simultaneously in multiple work areas by including the AGAIN keyword in USE and you do not specify an alias when opening the database in cach work area, a default alias is assigned automatically. The default aliases assigned in the first 10 work areas are the work area letters A through J; the aliases assigned in work areas 11 through 25 are W11 through W25. If a conflict occurs with aliases, a default alias will also be as- signed. Using an Alias If CUSTOMER.DBF is opened in work area C (or work area 3) and the default alias of CUSTOMER is assigned, you can move to this work area from another with any one of the following SELECT com- mands: SELECT C SELECT 3 SELECT customer You can also refer to database fields in other work areas by prefac- ing the field name with the alias pointer. Preface the ficld name with the alias name or the work area letter and a period or the > operator. If you're in work area C and you want to access a field called CON. TACT from the CUSTOMER database open in work area A, use one of the following: customer ..contact. A.contact The FoxPro Language Understanding the Language If you're in a work area other than A, the CUSTOMER database file is open in work area A and has the alias PEOPLE, you can use one of these commands: people. lastname A. lastname Referencing a Work Area You can reference a work area before a database is opened by using the work area letter or number. SELECT A SELECT 1 Memory Variables Occasionally memory variables are created with the same names as database field names. If a memory variable has a name that's the same as a database field name, FoxPro always gives the field precedence over the memory variable. You can reference a memory variable with the same name as a database field by in- cluding the M period or M-> prefix to refer to the memory vari- able. For example: M. lastname Functions and Memo Fields FoxPro memo fields can contain any data whatsoever, including nulls, assembler code, printer drivers, etc., and they may be any length. However, not all string and character functions can be used with memo fields. ‘The following functions are the only ones that operate directly on FoxPro’s unlimited memo fields: 8 LEN( ) ATC) ATCO) ATLINE( ) ATCLINE( ) MEMLINES( ) MLINE( ) SUBSTR( ) In addition, the REPLACE command permits an arbitrary length memo field or a substring of an arbitrary length memo field to replace another memo field. ‘The FoxPro Language C121 Understanding the Language 1-22 Memo fields may be stored as memory resident strings. These strings can then be manipulated with ail functions that operate on character data, String length is limited to 64K in the standard version of FoxPro, and is limited only by available memory in the Extended version, Typographic Conventions While most of the material in this manual deals directly with the FoxPro language, some of the commands have counterparts in the FoxPro interface. When describing actions that occur in the inter- face, we'll use the following conventions. Controls When we refer to FoxPro controls, such as lists, menu pads, popups, popup options, push buttons, radio buttons and check boxes, we always highlight the name of the control in bold type. For example: Choose Save on the File menu popup. Windows and Dialogs Names of FoxPro system windows and dialogs always appear in regular text with an initial capital. For example: ‘Type this statement in the Command window to bring for- ward the Structure dialog. Input and Output Examples of commands that you can type into the Command win- dow or a program appear in Courier font. For example: STORE amt_due - amt_paid TO new bal REPLACE ant_due WITH new bal When you issue a command or function that causes output to ap- pear on the screen or in a window, the resulting output appears in the documentation in Courier Bold. For example: AVERAGE taxrate FOR state = 'CH" 25 records averaged. ‘TAXRATE 5.81 The FoxPro Language 2 Commands and Functions by Category ‘This chapter presents the FoxPro commands and functions in an abbreviated form, grouped into categories based on purpose. Many commands and functions fall into more than one category. Use this chapter when you don’t know which command or function to use to perform a particular task. ‘The table below shows the categories, grouped by their broader purpose, and the page number in this chapter where you can find a category and its associated commands and functions. Categories Character Functions Numeric Functions Date and Time Functions Data Conversion Field Manipulation Database Manipulation Record Manipulation Indexes Relations Debugging and Error Handling Program Execution Structured Programming Low-level File Functions Memory Variable Manipulation Array Manipulation Event Handlers Input and Data Formatting Output Printing ‘Menu Bars and Popups Windows Typing, Keyboard and Mouse Reports and Labels FoxPro Environment Environment _ | File Management Network - Network Commands & Functions FoxPro/LAN Commands and Functions by Category C2-1 Data Types - Character Functions Data Types Character Functions 2-2 The entries in this category operate on character type data. $ — Determines if a character string is contained inside another character string or memo field. ALLTRIM( ) — Removes leading and trailing blanks from a charac- ter string. ASC( ) — Returns the ASCII code for the leftmost character in a character string. AT( ) — Returns the position (as an integer) of the first occurrence of a character expression within another character expression or memo field. ATC( ) - Returns the position (as an integer) of the first occur- rence of a character expression within another character expres- sion or memo field. Unlike the AT( ) function, ATC( ) is not case sensitive. ATCLINE( ) — Returns the line number (as an integer) of the first occurrence of a character expression within a character expression or memo field. ‘The value returned is dependent upon the value specified by the SET MEMOWIDTH command. ATCLINE( ) is similar to the ATLINE( ) function, although not case sensitive. ATLINE( ) — Returns the line number (as an integer) of the first occurrence of a character expression within a character expression or memo field, The value returned is dependent upon the value specified by the SET MEMOWIDTH command. BETWEEN( ) ~ Determines if a character expression lies between two other character expressions. CHR( ) - Returns the character for the specified numeric ASCII code, CHRTRAN( ) — ‘Translates a character string using two other strings as translation tables. CTOD( )- Converts a character type date to a date type date. DIFFERENCE( ) — Returns a number representing a relative phonetic difference between two character strings. DTOC( ) — Converts a date to a character type date. Commands and Functions by Category Data Types - Character Functions EMPTY( ) — Determines if an expression is “blank”. EVALUATE( )— Evaluates an expression and returns the result, INLIST( ) — Determines if a character expression is contained in a series of character expressions. INT( ) — Converts a number to its integer value by removing the decimal portion. ISALPHA( ) — Returns true (T.) if the specified character expres- sion begins with an alphabetical character. ISDIGIT( ) — Returns the value true (T.) if the first character of an expression is a digit (0 - 9). ISLOWER( ) — Returns true (.T.) if the first character in a eharac- ter expression is lower-case. ISUPPER( ) — Returns true (.T.) if the first character in a charac- ter expression is upper-case. LEFT( ) — Returns a specified number of characters, starting from the leftmost character in a character string. LEN( )- Returns the length of a character string. LIKE( ) — Allows you to compare a character string containing wild card characters to another character string. LOWER( )~ Converts all characters in a string to their lower-case equivalent. LTRIM( ) — Removes the leading blanks from a specified character string. MAX( ) - Returns the largest expression from a list of character, numeric or date expressions. MIN( ) — Returns the smallest expression in a series of character, numeric or date expressions. OCCURS( ) — Returns the number of occurrences of a character string within another character string. PADC( ) — Pads a character string on both sides with a specified character. PADL( ) - Pads a character string on the left with a specified character. PADR( ) — Pads a character string on the right with a specified character. Commands and Functions by Category C2-3 Data Types - Character Functions C2-4 PROPER( ) — Returns an expression capitalized as appropriate for proper names. RAT( ) — Searches a character string or memo field for the last, occurrence of another character string and returns as an integer the position where it was found, RATLINE( ) — Searches a character string or memo field for the last occurrence of another character string and returns as an in- teger the line number where it was found. The value returned is dependent upon the value specified by the SET MEMOWIDTH com- mand. REPLICATE( ) — Returns a character string that repeats a specified character expression a given number of times. RIGHT( ) — Returns the rightmost portion of a character string, RTRIM( ) — Removes all trailing blanks from the specified charac- ter string. SOUNDEX( ) — Returns a phonetic representation of a character expression. SPACE( ) - Returns a character string composed of a specified number of spaces. STR( ) ~ Returns the character string equivalent of a numeric ex- pression, STRTRAN( ) ~ Searches a character string for the occurrence of a second character string, then replaces it with a third character string, STUFF( ) — Returns a character string resulting from the replace- ment of a specified portion of one character expression with another character expression. SUBSTR( ) - Returns a specified number of characters from the given expression or memo field. SYS(10) — Converts a numeric day number into a character string. SYS(15) - Returns a character from a translation table. SYS(2007) ~ Returns the check sum value of a character string. TRANSFORM ) ~ Formats character and numeric output without using the @ ... SAY command. TRIM( ) ~ Removes all trailing blanks from the specified character string, Commands and Functions by Category Data Types - Numeric Functions TYPE( ) — Returns the data type of the expression (character, numeric, logical, date or memo). UPPER( ) — Returns a specified character expression in upper- case. Numeric Functions The entries in this category operate on and/or return numeric data. % ~ Returns the remainder obtained by dividing a numeric expres- sion by another numeric expression ABS( ) — Returns the absolute value. ACOS( ) - Returns the are cosine. ASIN( ) — Returns the arc sine. ATAN( ) — Returns the arc tangent. ATN2( ) — Returns the arc tangent in all four quadrants, BETWEEN( ) — Determines if a numeric expression lies between two other numeric expressions. CALCULATE ~ Performs financial and statistical operations. CEILING( ) — Returns the nearest integer that is greater than or equal to the value you provide. COS{ ) ~ Returns the cosine of an angle. DTOR( )- Converts degrees to radians. EMPTY( ) — Determines if a numeric expression equals zero, EXP( ) — Returns the value of e * where x is a specified value. FLOOR( ) — Returns the nearest integer less than or equal to the value you provide, FV( )~ Returns the future value of an investment. INT( ) — Converts a number to its integer value by removing the decimal portion. LOG( ) — Returns the natural logarithm of the value of a numeric expression. LOG10( ) — Returns the common logarithm (base 10) of the value of a numeric expression. Commands and Functions by Category C2-5 Data Types - Date and Time Functions MAX( ) - Returns the largest expression from a list of character, numeric or date expressions. MIN( ) — Returns the smallest expression in a series of character, numeric or date expressions. MOD( ) — Returns the remainder from a division operation. PAYMENT( ) ~ Returns the amount of each periodic payment on a loan. PI )— Returns the value of x. PV( )— Returns the present value of an investment, RAND( ) — Returns a random number. ROUND( ) — Rounds the value of a numeric expression to a specified number of decimal places. RTOD( ) — Converts radians to degrees. SET DECIMALS — Specifies the number of decimal places displayed in numeric results. SIGN( ) - Returns a numeric value dependent upon the sign of the number you provide. SIN( )— Returns the sine of an angle SQRT( ) - Returns the square root of the value of a numeric ex- pression. TAN( )~ Returns the tangent of an angle. VAL( ) - Converts a string of numeral characters to a numeric value. Date and Time Functions C2-6 ‘The entries in this section allow you to generate and manipulate date and time data. BETWEEN ) — Determines if a date expression lies between two other date expressions. CDOW( ) — Returns the name of the day (Sunday, Monday, Tues- day, ete.) for a given date CMONTH( ) — Returns the name of the month (January, February, March, etc.) for a given date. Commands and Functions by Category Data Types - Date and Time Functions CTOD( ) - Returns a date type date for a given character type date. DATE( ) — Returns the current system date. DAY( ) — Returns the day of the month (numeric) for a given date. DMY( ) — Converts a date expression to a Day Month Year European format. DOW( ) — Returns the day of the week (numeric) for a given date. DTOC( ) Converts a date to a character type date. DTOS( ) - Converts a date expression to a character string. EMPTY( ) — Determines if a date expression is “blank”. GOMONTH( ) - Returns the date that is a specified number of months before or after a given date. INLIST( ) - Determines if a date expression is contained in a series of date expressions, MAX( ) — Returns the largest expression from a list of character, numeric or date expressions. MDY( ) — Converts a date expression to a Month Day Year American format. MIN( ) — Returns the smallest expression in a series of character, numeric or date expressions. MONTH( ) — Returns the month (numeric) for a given date. SECONDS() - Returns the system time in the form seconds.thousandths with a resolution of 1 millisecond, SET HOURS -~ Sets the system clock to a 12 or 24 hour format. SET MARK TO — Specifies a delimiter in dates. SYS(1) — Returns the system date as a Julian day number. SYS(2) — Returns the number of seconds elapsed since midnight. SYS(10) — Converts a numeric day number into a character string. SYS(11) — Returns a Julian day number equivalent to a given date. TIME( )— Returns the current system time. YEAR( ) — Returns the year from a date expression. Commands and Functions by Category C2-7 Data Types - Data Conversion Data Conversion C28 ‘The functions in this category convert data from one type to another. ‘CHR( ) — Returns a character corresponding to the specified ASCII number. CTOD( )— Converts a character type date to a date type date. ‘SYS(10) — Converts a numeric day number into a character string. SYS(15) — Returns a character from a translation table. TRANSFORM ) — Formats character and numeric output without using the @ ... SAY command. Commands and Functions by Category Databases - Field Manipulation Databases Field Manipulation ‘This category contains commands and functions that allow you to manipulate database fields. AFIELDS( ) — Places database structure information into an array. DELETED( ) — Returns true (T.) if the current record is marked for deletion. FCOUNT( ) - Returns the number of fields in a database in a specified work area. FIELD( ) — Returns the name of the field (referenced by number) in a specified work area FSIZE( ) - Returns the size in bytes of a specified field. GATHER — Stores array data to database fields. LUPDATE( ) — Returns the date a database was last updated. NDX( ) - Returns the name of an open index file in a specified work area. SCATTER - Fills array elements with the contents of database fields. SET BLOCKSIZE — Specifies how FoxPro allocates disk space for storage of memo fields SET EXACT — Specifies whether an exact match in the length of two strings is necessary during a string comparison. SET TEXTMERGE - Enables or disables evaluation of database fields. SET TEXTMERGE DELIMITERS - Specifies the text merge delimiters. SYS(14) — Returns the key expression of an index file. Commands and Functions by Category C2-9 Databases - Database Manipulation Database Manipulation €2-10 The entries in this section allow you to create, manipulate and monitor database files. APPEND MEMO - Fills a memo field from a file. AVERAGE - Computes the arithmetic mean, optionally storing the results in an array or to memory variables. BROWSE -— Opens a Browse window so you can view and/or edit database records. CHANGE or EDIT — Displays database fields for editing. CLOSE DATABASES — Closes all open database, index, memo and format files. CLOSE MEMO - Closes a memo editing window. COPY MEMO - Copies the contents of a memo field to another file. COPY STRUCTURE - Copies the structure of a database to another file. COPY TO ~ Copies the contents of one database file to another database file. COPY STRUCTURE EXTENDED - Copies the structure of one database to a special database. COUNT ~ Counts the number of specified records, optionally stor- ing the result in a memory variable, CREATE -~ Creates a new database file structure. CREATE FROM ~ Creates a new database structure from a COPY STRUCTURE EXTENDED database file. CREATE QUERY ~ Opens the RQBE window so you can create a query. CREATE TABLE — Creates a database. DELETE — Marks records for deletion. DELETED( ) — Returns true (.T.) if the current record is marked for deletion. DISPLAY STRUCTURE -— Displays the structure of a database file. Commands and Funetions by Category Databases - Database Manipulation EXPORT — Copies data from a FoxPro database to a file with a different format. FLUSH — Flushes all active memory buffers to disk. IMPORT — Imports data from a different file format to create a new FoxPro database. MEMLINES( ) — Returns the number of lines in a memo field. The number of lines returned is affected by the memo width. Memo width is specified by the SET MEMOWIDTH command. MLINE( ) — Returns a line from a memo field as a character string. MODIFY QUERY - Modifies (or creates) a query. MODIFY MEMO — Opens an editing window for a memo field. MODIFY STRUCTURE - Allows you to modify a database struc- ture. PACK — Removes all records marked for deletion. RECALL — Unmarks records that are marked for deletion. REPLACE — Updates database records with data from an expres- sion. SELECT - Activates the specified work area. SELECT - SQL — Retrieves data from one or more databases. SET ANSI — Specifies how SQL string comparisons are made, SET AUTOSAVE — Flushes all active memory buffers to disk. SET DELETED - Enables or disables access to records marked for deletion. SET FIELDS — Specifies access to all fields or only those fields in- cluded in a field list. SET OPTIMIZE — Enables or disables Rushmore. SORT — Sorts data in an existing database and outputs the sorted data to a new database file. SUM - Totals the numeric field values in a database. TOTAL - Creates summary records in a new database file, one record for each group of identically-keyed records in the selected database. Commands and Functions by Category C2-11 Databases - Record Manipulation UPDATE — Updates fields in one database with data from another database. USE - Opens a database file and associated index files. USED( ) — Returns true (.T.) if a database is open in a specified work area, ZAP — Removes all records from a database. Record Manipulation C2-12 The commands and functions under this heading allow you to select records within a database or position the record pointer. APPEND - Adds a record to the end of a database. APPEND FROM ~ Adds records to a database from another file. CONTINUE — Continues the previous LOCATE command. FILTER( )~ Returns the filter expression for a specified work area. GO or GOTO — Positions the record pointer at a specific record number. INSERT - Inserts a new database record. INSERT — SQL — Appends a record to the end of a database. LOCATE — Searches the selected database for the first record that matches a given expression. LOOKUP( ) — Searches a database for the first occurrence of a specified expression. SEEK - Positions the record pointer to the first record in an in- dexed database that matches a specified expression. SEEK( ) ~ Returns true (.T.) if a SEEK was successful. SET FILTER — Specifies a condition that records in the selected database must meet to be accessible, SET NEAR - Determines where the record pointer will be posi- tioned after an unsuccessful search for a record. SET RELATION — Links or unlinks two or more open databases. SKIP — Moves the record pointer forward or backward in the selected database. Commands and Functions by Category Databases - Indexes Indexes ‘The commands and functions under this entry perform operations on and return information about index files. CDX( ) — Returns the names of open .CDX compound index files, CLOSE INDEX - Closes all open index files in the selected work area. COPY INDEXES — Copies single entry index files to a compound index file. COPY TAG - Creates a single entry index file from a tag in a compound index file. DELETE TAG - Removes a tag or tags from a .CDX compound index file. INDEX — Creates an index file to display a database in logical order. KEY( ) - Returns the key index expression of the master (control- ling) index file. MDX( ) - Returns the names of open .CDX compound index files NDX( ) — Returns the name of an open index in a specified work area. ORDER( ) - Returns the name of the master index file in a specified work area. REINDEX — Rebuilds an index file. SET INDEX - Selects one or more index files for use with the cur- rent database file. SET ORDER ~ Specifies the index file that will be used to deter- mine the logical order of the database. SET UNIQUE ~ Enables or disables the maintenance of duplicate keys in an index file SYS(14) — Returns the index expression of an index file. SYS(21) — Returns the number of the master controlling index in the currently selected work area. SYS(2021) — Returns the index filter expression. TAG( ) — Returns tag names from .CDX compound index files or the names of .IDX index files. Commands and Functions by Category 2-13 Databases - Relations Relations C214 The commands and functions in this category allow you to estab- lish or break relations between database files. RELATION( ) — Returns the linking expression in a specified work area. SELECT - SQL ~ Retrieves data from one or more databases. SET RELATION — Links two (or more) open databases. SET RELATION OFF ~ Breaks an established relation between two open databases. SET SKIP — Creates one-to-many relationships between databases. TARGET( ) — Returns the target work area for a relation. Commands and Functions by Category Programming - Debugging and Error Handling Programming Debugging and Error Handling ‘The following commands and functions perform various debugging operations with FoxPro programs. ERROR( ) — Returns the error number for an error that triggered an ON ERROR condition, EXTERNAL - Alerts the Project Manager to an undefined reference LINENO( ) - Returns the relative line number of an executing pro- gram. MESSAGE( ) — Returns the current error message. NOTE | * | && — Indicates non-executing comments in a program. ON ERROR - Executes a command (generally a branch in program execution) when an error occurs. ON READERROR - Executes a routine in response to an input error. ON( ) — Returns the command assigned to ON ERROR, ON ESCAPE, ON KEY, ON KEY LABEL, ON PAGE and ON READERROR. PROGRAM ) — Returns the name of the program currently being executed or the name of the program that was executing when the last error occurred, RETRY — Returns control to the calling program and re-executes the last command. SET DEBUG -— Enables or disables access to the Debug and Trace windows. SET DEVELOPMENT - Compares the creation date and time of a program file und its compiled object file. SET ECHO — Activates the Trace window for program debugging. SET TALK — Enables or disables the display of command results to the screen or a window. SET TRBETWEEN - Enables or disables tracing between break- points in Trace window. ‘SYS(16) - Returns the name of the program that’s executing. Commands and Functions by Category C2-15 Programming - Program Execution SYS(18) — Returns the name of the field that data was being entered into when the designated ON KEY hot key was pressed. SYS(2018) — Returns the error message parameter, VARREAD( ) — Returns the name of the field being edited when an ON KEY routine was triggered. WAIT — Halts FoxPro operation until a character is sent from the keyboard, optionally storing the input in a memory variable. Program Execution C2-16 The following commands and functions perform actions associated with executing, suspending and terminating FoxPro programs. BUILD APP — Creates an application (.APP) from a project file. BUILD EXE — For owners of the FoxPro Distribution Kit, creates an executable (.EXB) file from a project. BUILD PROJECT — Creates and builds a project. CALL - Executes a binary file that has been placed in memory with the LOAD command, CANCEL ~ Stops FoxPro program execution. CLEAR PROGRAM - Clears the compiled program buffer. CLOSE ALL — Closes all file types in all work areas and selects work area 1. CLOSE PROCEDURE — Closes an open procedure file. COMPILE — Compiles a program and creates an object file. CREATE PROJECT - Creates a project. DO — Executes a command or procedure file. FUNCTION — Defines the start of a routine. LOAD — Places a binary file in memory to be executed with the CALL command, MODIFY PROJECT ~ Modifies (or creates) a project. PARAMETERS ~ Identifies variables passed from a calling pro- gram. PARAMETERS( ) - Returns the number of parameters that were passed to the most recently called procedure. Commands and Functions by Category Programming - Structured Programming PROCEDURE - Identifies the beginning of a routine. RELEASE MODULE - Releases a loaded binary module from memory. RESUME — Resumes execution of a suspended program. RETURN — Returns control to the calling program. RUN | ! - Temporarily transfers control to DOS to execute an exter- nal command or program. SET ESCAPE ~ Enables or disables trapping of a press of the Es- cape key during program execution. SET LIBRARY — Specifies an external library. SET LOGERRORS - Saves compilation error messages to a text file. SET PROCEDURE - Opens a procedure file. SET SYSMENU - Enables or disables access to the system menu bar during program execution. SET UDFPARMS - Specifies whether parameters are passed to a user-defined function (UDI) by value or reference. SUSPEND — Suspends program execution. ‘SYS(2015) — Returns a unique procedure name. UDFs — User-defined functions (UDFs) allow you to add one or more specially designed functions that may return a value to the calling program. WAIT — Halts FoxPro operation until a character is sent from the keyboard, optionally storing the input in a memory variable. Structured Programming ‘These command and functions are used to control program execu- tion and branching within a FoxPro program, DO CASE ... ENDCASE - Executes one statement block (or pos- sibly none) from a set of conditional choices. DO WHILE ... ENDDO - Executes a block of statements within a conditional loop. EXIT — Exits a DO WHILE, FOR or SCAN loop. Commands and Functions by Category 2-17 Programming - Low-Level File Functions FOR ... ENDFOR — Executes statements in a loop a specified number of times. IF... ENDIF — Conditionally executes a set of commands based on the outcome of a logical expression. llF() — An alternate form of the IF structure. Returns one of two values based on a logical expression. SCAN ... ENDSCAN — Moves through a database and conditional- ly executes commands. Low-Level File Functions C2-18 The following functions are available in FoxPro to manipulate files and communication ports at a low level. Low-level file functions should be used carefully, especially when manipulating database files. Test sample files before using these functions on files that contain important data. FCHSIZE( ) — Changes the size of a file opened with a low-level file function FCLOSE( ) — Closes a file opened with a low-level command. FCREATE( ) — Creates and opens a low-level file. FEOF( ) — Determines if the file pointer is at the end of a file. FERROR( ) ~ Returns a 0 if the last low-level function was suc- cessfully executed; otherwise a value corresponding to the cause of the error. FFLUSH( ) — Flushes a file to disk. FGETS( ) — Returns a series of bytes from a file opened with a low-level command FOPEN( ) - Opens a file for use. FPUTS( ) — Write to a file opened with a low-level command. FREAD( ) — Returns as a character string a specified number of bytes from a file. FSEEK( ) — Moves the file pointer in a file opened with a low-level command. FWRITE( ) — Write to a file opened with a low-level command. HEADER( ) — Returns the number of bytes in the header of the database open in a specified work area. Commands and Funetions by Category Programming - Memory Variable Manipulation Memory Variable Manipulation ‘The commands and functions in this category allow you to assign values to memory variables. & — Macro substitution. = — Assigns a value to a memory variable (if a memory variable appears to the left of the =). ACOPY( ) — Copies elements from one memory variable array to another. ADEL( ) — Deletes an element, row or column from an array. ADIR( ) — Places matching file information into an array. AELEMENT( ) — Returns an array element's number from its row and column subscripts. AFIELDS( ) — Places database structure information into an array. AINS( ) - Inserts an element, row or column into an array. ALEN( ) — Returns the number of elements, rows or columns into an array. ASCAN( ) - Searches a memory variable array for an expression. ASORT( ) - Sorts a memory variable array in ascending or des- cending order. ASUBSCRIPT( ) — Returns a row or column element from an array element number. AVERAGE -— Computes the arithmetic mean, optionally storing the results in an array or to memory variables. CLEAR ALL — Clears memory variables, closes files, etc. CLEAR MEMORY - Removes all public and private memory vari- ables from memory. COUNT - Counts the number of records that meet the specified conditions, optionally storing the result in a memory variable DISPLAY or LIST MEMORY — Displays current memory variables. GETEXPR — Invokes the Expression Builder dialog and stores the user-constructed expression to a memory variable. Commands and Functions by Category 2-19 Programming - Array Manipulation PARAMETERS - Identifies variables passed from a calling pro- gram. PRIVATE — Defines local memory variables. PUBLIC — Defines global memory variables. REGIONAL ~ Creates regional memory variables and memory vari- able arrays. RELEASE — Releases memory variables. RESTORE FROM - Restores memory variables from a memory variable file or a memo field. SAVE TO — Saves memory variables to a memory variable file or a memo field. STORE - Assigns a value to a memory variable or initializes an array. ‘SUM — Adds the numeric field values within a database, optionally storing the results in an array or to memory variables. WAIT — Halts FoxPro operation until a character is sent from the keyboard, optionally storing the input in a memory variable. Array Manipulation C2-20 This category allows you to work with arrays of memory variables. ACOPY( ) — Copies elements from one memory variable array to another. ADEL( ) — Deletes an clement, row or column from an array. ADIR( ) — Places matching file information into an array. AELEMENT( ) ~ Returns an array element’s number from its row and column subscripts. AFIELDS( ) — Places database structure information into an array. AINS( ) — Inserts an clement, row or column into an array. ALEN( ) — Returns the number of elements, rows or columns into an array. ASCAN( ) — Searches a memory variable array for an expression. ASORT( ) ~ Sorts a memory variable array in ascending or des- cending order. Commands and Functions by Category Programming - Event Handlers ASUBSCRIPT( ) — Returns a row or column clement from an array element number. APPEND FROM ARRAY - Adds records to a database file from an. array. COPY TO ARRAY — Moves data from a database to an array. DECLARE -— Creates a one- or two-dimensional memory variable array. DIMENSION — Creates a one- or two-dimensional memory variable array. GATHER — Stores array data to database fields. SCATTER - Fills array elements with the contents of database fields. Event Handlers These commands specify the action to take when a given event occurs. ON ERROR - Executes a command (generally a branch in program execution) when an error occurs. ON ESCAPE - Executes a command (generally a branch in pro- gram execution) when Escape is pressed. ON KEY — Traps for the pressing of any key during program execu- tion and branches to a subroutine. ON KEY LABEL - Traps for specific keys being pressed during pro- gram execution and branches to a subroutine. ON PAD — Assigns a routine to a menu pad on a menu bar. ON SELECTION PAD — Assigns a routine to a menu pad. ON SELECTION POPUP — Assigns a routine to a popup. ON( ) — Returns the command assigned to ON ERROR, ON ESCAPE, ON KEY, ON KEY LABEL, ON PAGE and ON READERROR. Commands and Functions by Category 2-21 Input and Output - Data Formatting Input and Output Data Formatting 2-22 These commands and functions allow the formatting and display of data from records, fields, memory variables or arrays to the screen or a window. Entries under this heading also include general screen or window display features \ | \- Outputs lines of text ? — Displays the value of an expression on the next line, 22 — Displays the value of an expression on the same line, @ ... SAYIGET — Displays contents of database fields and memory variables for input or editing. @ ... GET — Check Boxes — Creates check boxes. @ ... GET — Invisible Buttons — Creates invisible buttons. @ ... GET — Lists — Creates lists. @ ... GET Popups ~ Creates popups. @ ... GET — Push Buttons — Creates push buttons. @ ... GET — Radio Buttons — Creates radio buttons @ .., Edit - Text Edit Regions — Creates text editing regions. @ ... BOX — Draws a box using a set of specified coordinates. @ ... CLEAR — Clears a portion of the screen or a window. @ ... FILL — Changes colors within an area of the screen or a window. @ ... TO — Draws lines and boxes on the screen or in a window. ACTIVATE SCREEN ~ Sends all subsequent output to the screen. APPEND - Adds a record to the end of a database. BROWSE — Opens a Browse window so you can view and/or edit. database records. CHANGE or EDIT — Displays database fields for editing. CLEAR - Erases the sereen or window. CLEAR READ ~ Exits an active read. Commands and Functions by Category Input and Output - Data Formatting CLOSE FORMAT - Closes an open format file. COL( ) — Returns the current column position of the cursor. CREATE SCREEN — Creates screen forms. DISPLAY or LIST — Displays records from a database. INKEY( ) — Returns an integer value corresponding to the input key pressed or a mouse click. MODIFY SCREEN — Modifies (or creates) a screen. OBJNUM( ) ~ Returns a GET object’s number. RDLEVEL( ) — Returns the current READ level. READ — Activates @ ... GET statements for editing. READKEY( ) — Returns an integer that represents the key pressed by the user in order to exit an editing command. RESTORE SCREEN — Restores a screen image ROW( ) — Returns the current row position of the cursor. SAVE SCREEN - Saves a screen image to a buffer, a memory vari- able or an array element. SCOLS( ) — Returns the number of columns available on the dis- play sereen. SCROLL — Scrolls an area of the screen or a window up or down. SET BLINK — Blinks screen elements or increases the number of colors available. SET CARRY - Enables or disables the ability to CARRY data for- ward. SET CLEAR — Enables or disables screen clearing. SET COLOR - Controls the color of the screen display, windows, dialogs, ete. SET CONFIRM — Enables or disables the necessity of pressing a terminating key to exit a field during editing. SET CONSOLE - Enables or disables sereen output. SET CURSOR - Turns the cursor on or off. Commands and Functions by Category C2-23 Input and Output - Data Formatting C2-24 SET DECIMALS ~ Sets the number of decimal places displayed in certain output operations. SET DEVICE - Controls the display of @ ... SAY output to a printer, the screen or a window. SET FIXED — Fixes the number of decimal places in numeric dis- play. SET HEADING ~ Enables or disables display of column titles for each field in the DISPLAY, LIST, SUM and AVERAGE commands. SET MARK TO — Specifies a delimiter in dates. SET MEMOWIDTH ~ Sets the width of memo field output for LIST and DISPLAY and sets the default width for REPORT. SET MESSAGE — Defines a message for display under the status bar or specifies the screen location of messages in menu bar and popup commands. SET ODOMETER — Changes the reporting interval in commands that report their progress. SET SPACE — Inserts a space between fields or expressions when using the ? or ?? commands. SET TEXTMERGE - Enables or disables evaluation of database fields. SET TEXTMERGE DELIMITERS — Specifies the text merge delimiters. SHOW GET — Redisplays a single GET object. SHOW GETS - Redisplays all GET objects. SHOW OBJECT - Redisplays a single GET object. References the object by number. SROWS( ) — Returns the number of rows available on the screen. SYS(7) — Returns the name of the current format file. SYS(100) — Returns the console setting last established by SET CONSOLE. SYS(101) — Returns the prior device setting. SYS(2002) — Turns the cursor on or off. TEXT ENDTEXT — Outputs lines of text, the results of expres- sions and functions and the contents of memory variables. Commands and Functions by Category Input and Output - Printing TRANSFORM( ) — Formats character and numeric output without using the @ ... SAY command. UDFs — User-defined functions (UDFs) allow you to add one or more specially designed functions that may return a value to the calling program. UPDATED( ) ~ Returns true (.T.) if any data was changed during the last READ. Printing ‘These commands and functions are used to print or display data from records or memory variables on the screen, to a printer or to an output file. \| \— Outputs lines of text 2 — Displays the value of an expression on the next line, 27 — Displays the value of an expression on the same line. 222 — Sends output directly to the printer, bypassing the printer driver. @ ... SAY — Directs formatted output to the screen or a window, to the printer or to a file. CLOSE ALTERNATE - Closes an open ALTERNATE file. DEFINE BOX — Draws a box around printed text. DISPLAY or LIST — Displays records from a database, EJECT — Sends a form feed to the printer. EJECT PAGE - Conditional page advance. ON PAGE - Executes a routine at a specified line number in reports. PCOL( ) — Returns the current column position of the printer. PRINTJOB ... ENDPRINTJOB ~ Activates printjob settings. PRINTSTATUS( ) — Returns true (.T.) if the printer is ready, false F,) if it is not. PROW( ) — Returns the current row position of the printer. SET MARGIN - Sets the left-hand printer margin. Commands and Functions by Category 2-25

You might also like