Neon Software


FoxExpress

Complete Reference Guide















 


Table of Contents



Introduction	Where to Find Information About FoxExpress
Document Conventions 
Part One	Introduction 
Functions and Procedures Reference (alphabetical) 
Part Two	CODE Database Reference
Part Three	Data Dictionary Reference
Part Four	Event Handler/Foundation Read Logic Reference
Part Five	Error Log Reference

Appendix A	Functions and Procedures by Categories




Where to Find Information About FoxExpress
Your FoxExpress software package contains the following three sources of 
information about FoxExpress in addition to this manual:
 The FoxExpress Users Guide provides information on what FoxExpress is; 
system requirements and recommendations; installation instructions;  and 
an overview of the entire FoxExpress User Interface.
 The FoxExpress Developers Guide teaches you step by step how to build a 
basic application that covers all features; application design guidelines and 
recommendations; the data dictionary; the event handler; the foundation 
read; User Defined Functions; customizing your applications; data entry 
screen types; and integrating non-FoxExpress screens and other third party 
products.
 The on-line help for FoxExpress is extensive and covers many of the topics 
covered in the printed manuals.   


Document Conventions
This manual will adhere to the following typographical conventions
Convention				Description 
UPPERCASE	UPPERCASE indicates the names 
of the functions and procedures in 
the library or a FoxPro keyword.
< > 	Angle brackets < > surrounding 
lowercase text indicate information 
that you provide such as an 
expression or a memory variable 
name.  Do not include the angle 
brackets when entering the 
command.
(  )	Parentheses must be included with  
all FoxExpress functions.  Include 
the parentheses as they appear in 
the functions syntax.
[  ]	Square brackets indicate a portion 
of a FoxExpress procedure or 
function that is optional.  Do not 
include the brackets.  
|	A vertical bar separating options 
indicates that you can enter only 
one of the options.  Do not include 
the vertical bar.
ALT+F1, CTRL+W	A plus sign (+) between key names 
indicates a combination of keys.  
For example ALT+F1 means to 
hold down the ALT key while 
pressing the F1 key.
m.findstr=BldFndStr(cust)	Code examples will be represented 
in this font.  
* This is a comment.	An asterisk (*) introduces 
comments in the code examples.



P A R T   O N E
FUNCTIONS and PROCEDURES Reference

Introduction
This section of the manual contains an alphabetic reference for the routines 
found in the FoxExpress FUNCTION and PROCEDURE library 
LIBRARY.PRG.  For a list of FUNCTIONs and PROCEDUREs by functional 
grouping (such as Data Dictionary or Event Handler) see Appendix A - 
Functions and Procedures by Category.  
Without the use of these routines making significant modifications to 
FoxExpress generated applications can be a difficult task.  These procedures 
and functions comprise the heart of the Data Dictionary, event handler and user 
interface in your generated applications.  They are designed to maintain the 
windowed environment in your application by following a specific 
methodology.  
Using the same routines when making modifications will help you to follow that 
methodology and preserve the integrity of the windowed environment.

















About
Purpose	Drives a dialog with five different screens containing complete information about the 
current state of the application.
Syntax	DO About
See Also	XXX
Description	This routine drives a dialog with five different screens containing complete information 
about the current state of the system and the application.

Author Information
The Author Information section is the first in the About dialog.  It contains the name of 
the company and individual who developed the application.

File Information
The File Information section is the second in the About dialog.  It contains the path and 
file name of the FOXUSER table/.DBF, the path and file name of the FoxPro CONFIG 
file, the current FoxPro home directory and the current FoxExpress directory.

Disk Information
The Disk Information section is the third in the About dialog.  It contains information on 
the total amount of disk space available, the path for temporary files, temporary file 
space available, temporary file disk size and the current directory.

Environment Information 
The Environment Information section is the fourth in the About dialog.  It contains 
information on the operating system version, the windows version, the DOS command 
processor, the windows directory, the type of CPU, the FoxPro version and version date 
and time stamp.

Memory Information 
The Memory Information section is the fifth in the About dialog.  It contains information 
on the total available memory, the remaining available memory, the available DOS 
memory and the current memory usage.
Example	This example invokes About to begin the About dialog for the user.

DO About


Add2Menu
Purpose	Adds a menu bar for the specified screen to the Window menu pad.
Syntax	DO Add2Menu( <expC> )
Parameters	<expC>	name of the window to add to the Window menu.
See Also	XXX
Description	Adds a menu bar for the specified screen to the Window menu pad.  The bar is added and 
an ON SELECTION is issued for the bar to drive the screen program associated wit that 
bar.
Example	This example calls Add2Menu to add a new menu bar for the screen CUSTOMER.

	DO Add2Menu(Customer)


AddMore
Purpose	Saves the current record and remains in add mode with another newly initialized record 
in the current table/.DBF.
Syntax	DO AddMore
See Also	AddRec, ddInitRec
Description	This routine saves the current record, adds another new one and initializes it for the 
current table/.DBF.
Example	This example invokes AddMore to start a cycle of continuous record adds.

AddMore()


AddRec
Purpose	Adds and initializes a new record in the current table/.DBF.
Syntax	DO AddRec
See Also	ddInitRec, DelRec, EditRec
Description	Adds and initializes a new record in the current table/.DBF.  Procedure ddInitRec is 
called to initialize each field with default values.
Example	This example calls AddRec to add a new record to the current table/.DBF.

	DO AddRec


Array2MVar   
Purpose	Copies the elements of a HOLD array to memory variables in preparation for restoring an 
add or edit window that was previously deactivated.
Syntax	DO Array2MVar
See Also	MVar2Array, ScreenOut
Description	For a FoxExpress application to be able to provide the user with multiple add and edit 
windows that are open simultaneously, it is necessary to save the current contents of the 
edit fields when the user deactivates the window before committing the edits.  
FoxExpress handles this by saving the field values into an array.
	Array2MVar will restore the memory variables for a given screen based on the value of 
the variable m.array_row.  Before this procedure is called m.array_row should point at 
the row of the winhndlr array that corresponds to the window being reactivated.  
Array2MVar works specifically with arrays created by MVar2Array. 
Example	Restore the contents of the memory variables for application window number 2.
 
m.array_row = 2
DO Array2MVar()


ASearch( )
Purpose	Searches an array for the specified value.
Syntax	ASearch( <array>, <expU>, <expN>, <expL1>, <expL2> )
Parameters	<array> 		is the array to be searched (passed by reference).
<expU> 		is the value to search for (can be any type of data)
<expN>		is the column in the array to search
<expL1>	If .T., indicates that the search is NOT case sensitive
		If .F., indicates that the search IS case sensitive
<expL2>	If .T., indicates that the comparison value is to be ALLTRIMd before 	
		comparing.
Returns	Numeric
See Also	XXX
Description	Searches an array for the specified value.  If the value is found then the routine will 
return the row number of the first row the value is found in.  If it is not found then a 
value of  0 is returned.  
Parameters	<array>
Specify the array to be searched with <array> which is an array passed by reference.
<expU>
Specify the value to search for (which can be any data type) with <expU>.
<expN>
Specify the column in the array to search with <expN>
<expL1>	
Specify whether the search is to be case sensitive or not.  If <expL1> is .T. true then the 
search will NOT be case sensitive.
<expL2>	
Specify whether or not the serach value should be ALLTRIMd before the search is 
begun. 
Example	This example XXX.
 
XXX


BldFndStr( )
Purpose	Builds a find string  variable suitable for use with the procedures Finder or Search.  It is 
based upon fields selected by the user.
Syntax	BldFndStr(<expC>)
Parameters	<expC> Comma delimited list of field names to search
Returns	Character
See Also	Finder, Search
Description	The generic search routine Finder requires that you pass a single string to it that contains, 
for each searchable field: the field prompt, a colon, the field name and a tilde.  

You can provide a string to BldFndStr that contains only the field names separated by 
commas and this routine will look up the field prompts in the Data Dictionary and 
include the necessary delimiters that Finder requires. 
Example	This example sets up a valid find string for the Finder procedure based on two searchable 
fields in the current database.  The fields are Custno and Lastupdate.
 
m.gcFindStr = BldFndStr(Custno,Lastupdate)


BtnMsg1( )
Purpose	Message clause for screens with MORE, SAVE and CANCEL button groups.
Syntax	BtnMsg1( )
Returns	Character
See Also	
Description	This routine is the message clause for screens that have the MORE, SAVE and CANCEL 
group of buttons.  In a FoxExpress application these screen types are In Window 
Scrolling Lists and External Window Scrolling Lists.

The routine returns a character string message appropriate to the button that has been 
selected by the user.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
MESSAGE clause.  

An example is not necessary because typical uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


CharMode( )
Purpose	Returns a string equivalent for the numeric screen mode that is specified.
Syntax	CharMode( <expN> )
Parameters	<expN>	Specifies the numeric screen mode to convert.
Returns	Character, either VIEW, ADD, EDIT, BROWSE or N/A  	
See Also	XXX
Description	An application screen can be in any of four different modes which are represented 
internally in FoxExpress by the numeric digits 0-3. CharMode( ) returns a string 
equivalent for the numeric screen mode that is specified.

The numeric is translated to either VIEW (0), ADD (1), EDIT (2), BROWSE (3) or N/A 
for any other value specified.      
Parameters	<expN>
<expN> specifies the numeric screen mode that is to be translated.
Example	This example
 
XXX  


CheckSec( )
Purpose	Returns the security level for a particular user for a given screen as defined in the user 
table/.DBF.  
Syntax	CheckSec( <expC1> , <expC2>)
Parameters	<expC1> The userid (initials) of the user you wish to check
<expC2> The screen name to check.
Returns	Numeric
See Also	
Description	CheckSec returns a numeric indicating the security level of the userid specified and for 
the screen program specified to the routine.

The value that is returned by this routine will be from 1-6 indicating different levels of 
security as follows:
Security
L  E  V  E  L

ADD

EDIT

DELETE
D

VIEW

1
X
X
X
X

2
 
 

X

  3
X


 

  4
 
X

 

5
X
X



6



 


		      FUNCTIONS

If a security level of 6 is returned then there is not a record for the userid in the user 
table/.DBF or the user has no access to the item in question.

Parameters	<expC1>
<expC1> specifies the userid to check security for
	<expC2>
Specifies the screen program to check the users security against.  The name of the screen 
program corresponds to a field name in the user table/.DBF.  This field in the user table 
contains the security value for the user for the screen program in question. 


Example	This example checks the security level for the userid DMT in the screen called 
CUSTOMER and places it into a memory variable called gcSecLevel.
 
m.gcSecLevel = CheckSec(DMT, CUSTOMER)


ChngPwrd
Purpose	Runs a dialog to allow the user to change their current password.
Syntax	DO ChngPwrd
Note	FoxPro DOS only.  FoxPro WINDOWS uses CHNGPWRD.SPR for the same function.
See Also	CHNGPWRD.SPR
Description	Runs a dialog allowing the user to change their current password.
	
XXX


CloseWindow
Purpose	Clears and closes the current read window.
Syntax	CloseWindow
See Also	KillWindow
Description	CloseWindow clears the read for the current window and then calls KillWindow to close 
the current window.  It also updates the winhndlr() array to reflect the change. 
	
An example is not necessary because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


CtrlActi
Purpose	READ ACTIVATE routine for screens that use the control panel. 
Syntax	CtrlActi
See Also	CtrlDeac, CtrlSetup, CtrlValid, CtrlWhen, FoxPro READ command
Description	CtrlActi is the READ ACTIVATE routine for all FoxExpress application screens that use 
the control panel.

This routine simply updates the global variable gnLastObj with the system variable 
_CUROBJ.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
ACTIVATE clause.


CtrlDeac( )
Purpose	READ DEACTIVATE routine for screens that use the control panel. 
Syntax	CtrlDeac
Returns	Logical  	
See Also	CtrlActi, CtrlSetup, CtrlValid, CtrlWhen, FoxPro READ command
Description	CtrlDeac is the READ DEACTIVATE routine for all FoxExpress application screens that 
use the control panel.

This routine is integral to the FoxExpress event handler.  It will check the current state of 
screens involved in the active READ to determine whether or not the READ can be 
terminated.  

In some situations the READ cannot possibly be terminated such as when the user is 
adding or editing in a dependent child window.  In other situations the READ can be 
terminated without question such as when the user clicks on a non-related window.

If the user has an add or edit active in the current screen and it is not a dependent child 
window (it is a main screen or a Full Featured Data Entry screen) then this routine 
prompts the user as to whether they want to save or cancel the changes.

When .T. is returned from this routine the READ VALID clause, CtrlValid, will be called 
by FoxPro and the READ will terminate, passing control to the foundation READ.  If the 
routine returns .F. the user will remain in the READ. 

Please refer to your FoxPro documentation for more information on the FoxPro READ 
VALID clause.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


CtrlLine
Purpose	Draws a line across the bottom of the horizontal picture button control panel. 
Syntax	DO CtrlLine
See Also	
Description	CtrlLine is used to draw a line across the bottom of the control panel.  It is only relevant 
to the horizontal picture button control panel.
Example	This example adds a line to the bottom of the horizontal picture button control panel.
 
DO CtrlLine


CtrlSetup
Purpose	Defines necessary screen environment for control panel. 
Syntax	CtrlSetup
See Also	CtrlActi, CtrlDeac, CtrlValid, CtrlWhen, FoxPro READ command
Description	CtrlSetup is used to setup the environment for screen programs that use the control panel.

It restores various environment information for screens that use the control panel such as 
the record number that was last accessed, security level for the user, the last used index 
tag, and restores the appropriate window for the screen.

This procedure was created in order to reduce the amount of code contained in the setup 
code of each control panel.  This was also done to reduce the maintenance necessary to 
propogate changes to all of the different styled control panels.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
VALID clause.

An example is not necessary because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 




CtrlValid( )
Purpose	READ VALID routine for screens that use the control panel. 
Syntax	CtrlValid
Returns	Logical  	
See Also	CtrlActi, CtrlDeac, CtrlSetup, CtrlWhen, FoxPro READ command
Description	CtrlValid is the READ VALID routine for all FoxExpress application screens that use the 
control panel.

This routine is integral to the FoxExpress event handler.  When a screen window has 
been successfully deactivated CtrlValid will complete the exit from the screen that was 
begun by CtrlDeac.  

It is also driven by other situations which it checks for such as the ESC key being pressed 
by the user or a READ time-out.
	If the user has an add or edit active in the current screen and it is not a dependent child 
window (it is a main screen or a Full Featured Data Entry screen) then this routine 
prompts the user as to whether they want to save or cancel the changes.

When .T. is returned from this routine the READ VALID clause, CtrlValid, will be called 
by FoxPro and the READ will terminate, passing control to the foundation READ.  If the 
routine returns .F. the user will remain in the READ.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
VALID clause.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


CtrlWhen( )
Purpose	READ WHEN routine for screens that use the control panel. 
Syntax	CtrlWhen
Returns	Logical  	
See Also	CtrlActi, CtrlDeac, CtrlSetup, CtrlValid, FoxPro READ command
Description	CtrlWhen is the READ WHEN routine for all FoxExpress application screens that use the 
control panel.

This routine is integral to the FoxExpress event handler.  It updates information in the 
windhandlr array such as: the window title and alias; it restores environment 
information such as the last index order that was used in the current screen, determines 
whether the screen was previously in an add or edit mode, whether the screen should be 
opened in browse and returns the cursor to the last used screen object.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
WHEN clause.  

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


ddBrowse( )
Purpose	Browse a table/.DBF based on data dictionary settings. 
Syntax	ddBrowse([<expC>] [,<expL>] )
Parameters	<expC>	The alias of the table/.DBF you want to browse
<expL>	If .T., indicates you want just the browse fields returned and no browse 
	window.
Returns	Unknown, usually Character.  	
See Also	BrowDbf
Description	ddBrowse will present a custom Browse as defined in the Data Dictionary for the 
table/.DBF whos alias is specified or the currently selected table/.DBF if no alias is 
specified.  It can also be used to return a list of field names that have been defined and 
included in the custom Browse definition.
Parameters	<expC>
<expC> specifies the alias of the table/.DBF that you want to display the browse for.  If 
none is specified then the current table/.DBFs custom Browse is displayed.
	<expL>
If .T. ddBrowse returns only the names of the fields defined in the browse, and no 
browse window is presented.
Example	This example presents the custom Browse defined in the Data Dictionary for table/.DBF 
CUSTOMER.
 
ddBrowse(Customer)


ddDbfNames( )
Purpose	Returns the table description for each table in the data dictionary into the elements of an 
array.
Syntax	ddDbfNames( <array> )
Parameters	<array> An array passed by reference to place the table descriptions into.
Returns	Logical, always .T.
See Also	ddGetName
Description	Places the table descriptions for each of the table/.DBFs defined in the data dictionary 
into the elements of an array that is passed by reference to the routine.  
Parameters	<array>
An array passed by reference to place the table descriptions into.
Example	This example uses ddDbfNames  to retrieve the table descriptions for all of the 
table/DBFs that are defined in the data dictionary for use in a selection list for the user.

DIMENSION laDbfNames[1]
=ddDbfNames(@laDbfNames)


ddDelete
Purpose	Deletes the current record in the current table/.DBF based on settings defined in the Data 
Dictionary for deletion and relational integrity. 
Syntax	DO ddDelete 
ddDelete()
See Also	DelRec
Description	ddDelete will attempt to delete the current record in the currently selected table/.DBF.  It 
will maintain parent/child relational integrity by following your specifications in the data 
dictionary.  

If the record pointer is at the beginning or end of file a message will be displayed.  If the 
record cannot be locked a message will be displayed.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.



ddError( )
Purpose	Executes the field level ERROR clause for a given field from the data dictionary. 
Syntax	ddError(<expC>)
Parameters	<expC>	The alias and field whose ERROR clause you want to execute.
Returns	Unknown, usually Character.  	
See Also	FoxPro READ command
Description	ddError executes the field level ERROR clause contained in the Data Dictionary for the 
alias and field passed to it as a parameter.  It can be found in the code snippet for all field 
level ERROR clauses throughout the screens in a FoxExpress application.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
ERROR clause.  
Parameters	<expC>
<expC> specifies the alias of the table/.DBF followed by the field name to execute the 
ERROR clause for, separated by a period.
Example	This example executes the field level ERROR clause for the field custno in the 
table/.DBF Customer.
 
ddError(Customer.custno)


ddGenKey( )
Purpose	Returns a generated key for the current selected table/DBF that is the next sequential key 
based on the definitions in the data dictionary. 
Syntax	ddGenKey( )
Returns	Unknown, depends on the type of variable of the key in question.  	
See Also	Increment, Rollover
Description	ddgenKey will return a generated key for the currently selected table/.DBF that is the 
next sequential key based on the definitions in the data dictionary.  

It will return either a character or numeric key depending on the key field that it is being 
generated for.  If the generated key becomes longer than the field it is intended for then 
the key rolls over to the beginning of the series.
Example	This example generates the next sequential key for the table CUSTOMER which has 
field cusno defined as a generated key in the data dictionary, after appending a new 
record. 
 
SELECT CUSTOMER
APPEND BLANK
REPLACE cusno WITH ddGenKey


ddGetFields
Purpose	Collects the DIALOG prompt defined in the data dictionary for each of the fields in a 
table/.DBF.  
Syntax	DO ddGetFields with <expC>
Parameters	<expC> Specifies the table/.DBF to collect the DIALOG prompts for.
See Also	ddList
Description	ddGetFields will collect the DIALOG prompt defined in the data dictionary for each of 
the fields in the table/.DBF that is passed to the routine.  The prompts are placed into an 
array called listarray.  
Example	This example collects the DIALOG prompts for the table CUSTOMER.
 
DO ddGetFields with CUSTOMER


ddGetJoins( )
Purpose	Returns the JOIN condition between two tables as defined in the data dictionary.  
Syntax	ddGetJoins( )
Parameters	<expC> Specifies the aliases of the parent and child table/.DBF separated by a comma.
Returns	Character.  	
See Also	XXX is it used?
Description	DDGETJOINS will return the JOIN condition between two tables as defined in the data 
dictionary.  
Example	This example displays the JOIN condition between the CUSTOMER and INVOICE 
tables as defined in the data dictionary.
 
m.twotables = CUSTOMER, INVOICE
? DDGETJOINS(m.twotables)


ddGetName( )
Purpose	Returns the description for a single table/.DBF from the data dictionary 
Syntax	ddGetName( )
Parameters	<expC> Specifies the table/.DBF to get the description for.
Returns	Character.  	
See Also	ddDbfNames
Description	ddGetName will return the description for a single table/.DBF from the data dictionary
Example	This example displays the description for the table ITEMS (which contains invoice line 
items) from the data dictionary
 
? ddGetName(ITEMS)


ddGetPict( )
Purpose	Returns the PICTURE clause for a single field level object from the data dictionary 
Syntax	ddGetPict( )
Parameters	<expC> Specifies the field level object to get the PICTURE clause for.
Returns	Character.  	
See Also	ddDbfNames
Description	ddGetPict will return the PICTURE clause for a single field level object from the data 
dictionary.
Parameters	<expC>
<expC> specifies the alias of the table/.DBF and the field name that you want to return 
the PICTURE clause for separated by a period.
Example	This example uses the PICTURE clause returned from ddGetPict to format a display of 
the same field.
	
	DO ddOpen WITH Customer
	SCATTER MEMVAR FIELDS Company
	lcPicture=ddGetPict(Customer.Company)
	@ 1,1 SAY Enter Company GET m.company PICTURE m.lcPicture
	READ



ddHas( )
Purpose	Returns true if a particular table/.DBF is defined in the data dictionary
Syntax	ddHas( <expC> )
Parameters	<expC>	Specifies the table/.DBF to check for in the data dictionary.
Returns	Logical  	
See Also	
Description	ddHas checks if a particular table/.DBF is defined in the Data Dictionary.    
Parameters	<expC>
<expC> specifies the name of the table/.DBF to check the data dictionary for.  
Function ddHas is not path sensitive.  It will only check based on the ALIAS portion of 
the path and file you specify. 

Whether you specify <expC> as \foxprow\express\customer.dbf or \test\customer you 
will get the same resulting ALIAS that gets checked: customer. 
Example	This example checks to see if the CUSTOMER table/.DBF is defined in the data 
dictionary.
 
USE customer
IF DDHAS(DBF())
  ? Customer DBF exists in the DATA DICTIONARY
ELSE
  ? Customer DBF was not found in the DATA DICTIONARY
ENDIF  


ddJBLook
Purpose	Called from the ddValid function to perform lookups based on parameters specified in 
the data dictionary.  Uses a JKEY BROWSE to allow the user to select a record if the 
users entry was not found.
Syntax	DO ddJBLook <WITH <expC>>
Notes	This function requires the SHAREWARE product JKEY by Joe Gotthelf.  In order to use 
this function JKEY must be copied to the application directory.  JKEY is SHAREWARE 
and is distributed with FoxExpress.  However if  you intend to use this function, you 
must properly register your copy of JKEY that came with FoxExpress.  File 
JKEY26.EXE is a self extracting EXE file that includes JKEY, all registration 
information and documentation.  This file can also be downloaded from the FoxForum 
on Compuserve.
Parameters	<expC1>	Database to perform look up in
<expC2>	Index tag name to use for look up
<expC3>	Title for browse window if SEEK fails
<expC4>	Search value
<expC5>	Value to update VARREAD() with when a selection is made
<expC6>	Specifies a FILTER expression for the lookup table
<expL>		If .T. then ignore case on the SEEK
See Also	XXX
Description	Function ddJBLook( )
Parameters	<expC1>
<expC> specifies the alias of the table/.DBF that you want to initialize a new record for.
<expC2>
<expC3>
<expC4>
<expC5>
<expC6>
<expL>


An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.



ddInitRec
Purpose	Initialize a new record based on Data Dictionary values
Syntax	DO ddInitRec <WITH <expC>>
Parameters	<expC>	Specifies the table/.DBF that want to have a new record initialized for.
See Also	AddRec, ListActn, ListVal
Description	Function ddInitRec initializes a new record for a given table by setting up the default 
values as specified in the Data Dictionary.    
Parameters	<expC>
<expC> specifies the alias of the table/.DBF that you want to initialize a new record for.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.



ddList( )
Purpose	Returns a list of each of the fields in a particular table/.DBF and optionally the child 
table/.DBF associated with it.  
Syntax	ddList( )
Parameters	<array> An array passed by reference to list the fields into
<expC> 	Specifies the table/.DBF to get the fields for
<expL> 	Specifies whether or not the fields of the child table/.DBF should also be 
	retrieved
Returns	Logical, always .T.  	
See Also	ddGetFields
Description	Function ddList( ) will collect all the fields names in a table/.DBF .  The field names are 
placed into an array that is passed by reference to the routine.
Parameters	<array>
<array> 	is an array passed by reference that is to contain the list of field names
<expC>
<expC> 	specifies the alias of the table/.DBF to retrieve the field names for.
<expL>
<expL> 	specifies whether or not the fields of the child table/.DBF are to be retrieved in 
	the list as well.
Example	This example retrieves the field names  for the table CUSTOMER and displays their 
values.
 
DIMENSION laFields[1,2]
	=ddList(@laFields,CUSTOMER)
	DISPLAY MEMORY LIKE laFields
	


ddLookUp( )
Purpose	Looks up a value in a secondary table based on options set in the data dictionary
Syntax	ddLookUp( )
Returns	Logical  	
See Also	ddValid
Description	ddLookUp looks up a value in a secondary table based on options set in the data 
dictionary.  If the value is not found in the secondary table a popup, as defined in the data 
dictionary is displayed for the user to choose a correct value.  

.T. is returned if the value entered or chosen is found in the secondary table.
 
ddLookUp is called automatically by ddValid.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.   


ddMessage( )
Purpose	Executes the field level MESSAGE clause for a given field from the data dictionary 
Syntax	ddMessage(<expC>)
Parameters	<expC>	The alias and field to execute the MESSAGE clause for.
Returns	Unknown, usually character  	
See Also	Foxpro READ command
Description	ddMessage executes the field level MESSAGE clause contained in the Data Dictionary 
for the alias and field passed to the procedure.  It can be found in the code snippet for all 
field level MESSAGE clauses throughout the screens in a FoxExpress application.  
Parameters	<expC>
<expC> specifies the alias of the table/.DBF and the field name that you want to execute 
the MESSAGE clause for separated by a period.
Example	This example executes the field level MESSAGE clause for the field custno in the 
table/.DBF Customer.
 
ddMessage(Customer.custno)


ddOpen( )
Purpose	Opens the data dictionary, one of the table/.DBFs defined in the data dictionary or all of 
the table/.DBFs defined in the data dictionary
Syntax	ddOpen([<expC1> | OPEN ALL, 
    [<expL>], 
    [<expC2>]
    [<expC3>]])
Parameters	<expC1>	Database to open
 	 	If OPEN ALL, ddOpen( ) opens every database in the Data 		
		Dictionary 
<expL> 	 	If .T. ddOpen( ) will open the specified table/.DBF in an unused 	
		work area
<expC2>	The mode for opening the table/.DBF.
		If EXCLUSIVE, opens the table/.DBF for exclusive use on a network
		If SHARED, opens the table/.DBF for shared use on a network
		If NOUPDATE, opens the table in READ ONLY mode
<expC3>	Index TAG to order table/.DBF by
Returns	Logical
See Also	
Description	ddOpen( ) opens the Data Dictionary, one of the table/.DBFs defined in the Data 
Dictionary or all of the table/.DBFs defined in the Data Dictionary.

If ddOpen( ) is issued without parameters then the Data Dictionary is opened.   If OPEN 
ALL is specified instead of a table/.DBF name then ddOpen( ) opens all table/.DBFs 
defined in the Data Dictionary.  

You can specify that you want to have the specified table/.DBF opened in an unused 
work area or the current work area.  You can select the open mode you want for a 
table/.DBF such as EXCLUSIVE or SHARED.  You can also specify the index TAG to 
order the table/.DBF by.
Parameters	<expC1>
<expC1> specifies the name of the table/.DBF you wish to open.

	<expL>
<expL> indicates the table/.DBF is to be opened in an unused work area if set to .T. 

<expC2>
By default the open mode for a table/.DBF opened by ddOpen( ) will be the same as the 
value of  SET EXCLUSIVE in Foxpro.  You can include <expC2> to specify the mode 
you want for opening the table/.DBF which can be either EXCLUSIVE, SHARED or 
NOUPDATE.

<expC3>
Using <expC3> you can specify the index TAG to order the table/.DBF by. 


Example	This example opens the table/.DBF Customer for exclusive use on a network in an 
unused work area and selects the index order with the tag name Custno.  The return 
value from the function is used as the condition in the IF statement in this example.
 
IF DDOPEN(Customer,.T.,"EXCLUSIVE",Custno) THEN
	  ? Customer Table Open Was Successful
ELSE
  ? Could NOT Open Customer Table
ENDIF


ddPrompt( )
Purpose	Returns one of the three data dictionary prompts (PROMPT, DIALOG or BROWSE) for 
a specified field in the currently selected table/.DBF.  
Syntax	ddPrompt(<expC1> [, PROMPT | DIALOG | BROWSE])
Parameters	<expC1> Name of Field
<expC2> If PROMPT, ddPrompt(  ) returns the prompt string (default)
	 If DIALOG, ddPrompt(  ) returns the DIALOG prompt string
	 If BROWSE, ddPrompt(  ) returns the BROWSE prompt string 
Returns	Character
See Also	 
Description	ddPrompt( ) returns a character string that represents one of the English language 
prompts in the data dictionary for a given field.
Parameters	<expC1>
<expC1> specifies the field name in the current table/.DBF that you want the prompt for.
	<expC2>
Include <expC2> to choose which of the three data dictionary prompts you wish to have 
returned - PROMPT, DIALOG or BROWSE.  The default is PROMPT.  
Example	This example gets the BROWSE prompt for the field custno in the currently selected 
table/.DBF and places it into a memory variable called gcPrmtStr.
 
m.gcPrmtStr = ddprompt(custno, BROWSE)


ddRequired( )
Purpose	Ensures that all of the fields in the currently selected table/.DBF that are defined in the 
data dictionary as REQUIRED have a value in them.
Syntax	ddRequired( )
Returns	Logical
See Also	SaveRec, ListActn, ListVal
Description	ddRequired ensures that all of the fields in the currently selected table/.DBF that are 
defined in the data dictionary as REQUIRED have a value in them.  If all of them have a 
value (i.e. are not EMPTY) then a value of true is returned.

If any of these fields are EMPTY then a value of false is returned and the cursor is placed 
into the get object of the first EMPTY required field.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


ddShow( )
Purpose	Displays a field or expression from a related table as defined in the data dictionary.
Syntax	ddShow( <expC> )
Parameters	<expC>	The alias and field whose SHOW clause you want to execute.
Returns	Unknown, depends on type of field data being shown.  	
See Also	FoxPro READ command
Description	ddShow( ) displays a field or expression from a related table as defined in the data 
dictionary.  It is commonly placed on a data entry screen as a SAY field.

To use ddShow( ) a relationship must exist in the data dictionary where the current table 
is the parent and the child is the table the field to display is in.  

This function assumes the parent table is open in the currently selected work area.  An 
index in the child table must exist with the keyfield from the child table as the 
expression.  The index expression and field name must be the same. Make sure refresh is 
checked for the expression in Screen Builder. 

As long as the first SAY field from the related table in the screen is displayed using 
ddShow( ), additional fields may be displayed by just placing <alias.fieldname> on 
screen as a SAY expression with refresh checked.

Parameters	<expC>
<expC> specifies the alias of the table/.DBF followed by the field name to execute the 
SHOW clause for, separated by a period.
Example	This example displays the field custno from the table/.DBF Customer.
 
@SAY 23,42 ddShow(Customer.custno)


ddUnique( )
Purpose	Used by the data dictionary to determine if an entry is unique.
Syntax	ddUnique( )
Returns	Logical.  	
See Also	XXX
Description	Function ddUnique( ) is called by ddValid once for each field that has the unique 
property selected in the data dictionary.


ddValid( )
Purpose	Executes the field level VALID clause for a given field from the data dictionary.   Also 
calls the routines to check field properties in the data dicitonary related to validation, for 
example lookup and unique.
Syntax	ddValid(<expC>)
Parameters	<expC>	The field from the currently selected table/.DBF to validate.
Returns	Unknown, usually Logical.  	
See Also	Foxpro READ command
Description	Function ddValid( ) executes the field level VALID clause contained in the Data 
Dictionary for the field in the currently selected table/.DBF which is passed to it as a 
parameter.  It can be found in the code snippet for all field level VALID clauses 
throughout the screens in a FoxExpress application.  

Please refer to your FoxPro documentation for more information on the FoxPro READ 
VALID clause.
Parameters	<expC>
<expC> specifies the field name in the current selected table/.DBF that you want to 
execute the VALID clause for.
Example	This example executes the field level VALID clause for the field custno in the currently 
selected table/.DBF.
 
ddValid(custno)


ddWhen( )
Purpose	Executes the field level WHEN clause for a given field from the Data Dictionary. 
Syntax	ddWhen(<expC>)
Parameters	<expC>	The alias and field whose WHEN clause you want to execute.
Returns	Unknown, usually Logical.  	
See Also	Foxpro field level WHEN clause command
Description	ddWhen( ) executes the field level WHEN clause contained in the data dictionary for the 
alias and field passed to it as a parameter.  It can be found in the code snippet for all field 
level WHEN clauses throughout the screens in a FoxExpress application.  
Parameters	<expC>
<expC> specifies the alias of the table/.DBF and the field name that you want to execute 
the WHEN clause for separated by a period.
Example	This example executes the field level WHEN clause for the field custno in the 
table/.DBF Customer.
 
DDWHEN(Customer.custno)


DelList
Purpose	Deletes all of the records specified by record number in the array from the specified 
table.   Invoked when the user cancels adding a record in a screen that contains an In 
Window Scrolling List or an External Window Scrolling List.
Syntax	DelList( <array>, <expC> )
Parameters	<array>		An array containing the record numbers to be deleted
<expC>		The table/.DBF to delete the records from
Description	DelList( ) will automatically delete all of the records by record number are in the array 
that is passed to the routine from the specified table/.DBF. 
Parameters	<array>
<array> is the list display data and the record number for each record in the list.
	the array should have one row for each record to be deleted with two columns. 
	The 1st column should contain the data displayed in the list and the 2nd 
	column should contain the associated record numbers. 
	<expC>
<expC> specifies the table/.DBF to delete the records from.



DelMain
Purpose	Deletes the current record from the currently selected table/.DBF. 
Syntax	DelMain( )
See Also	ddDelete
Description	DelMain( ) will delete the current record form the currently selected table/.DBF. 

Example	N/A called from ddDelete


DelRec
Purpose	Attempts to delete the current record in the current table/.DBF and determines which 
type of screen is requesting the delete.
Syntax	DO DelRec
See Also	ffDelete, ddDelete
Description	Attempts to delete the current record in the current table/.DBF after determining which 
type of data entry screen is requesting the delete. 

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


Dialog( )
Purpose	Display any one of the numerous standard dialog boxes and return a prompt from the 
users selection. 
Syntax	Dialog( <expC1>, <expC2>, <expN> )
Parameters	<expC1>	The message to display in the dialog box
<expC2>	The title for the dialog window
<expN>		The number of the predefined dialog box to display, see table below
Returns	Character, the value of the prompt selected by the user.  	
See Also	FOXTOOLS
Description	Dialog( ) presents one of the many standard dialog boxes and returns the value of the 
prompt selected by the user.  When used with FOXTOOLS.FLL from the FOXPRO For 
Windows tools this routine has the most functionality.  Code using this routine is also 
compatible in DOS or in Windows without FOXTOOLS.FLL.

Parameters	<expC1>
<expC1> specifies the message to display in the dialog box.
	<expC2>
<expC2> specifies the title for the dialog window.
	<expN>
<expN> specifies the number of the predefined dialog box. 

If FOXTOOLS.FLL is available on your system all of the following standard dialogs are 
available which are combinations of a set of buttons and an icon:
	     B   U   T   T  O  N  S

I  C  O  N

OK
OK 
 
CANCEL
ABORT
 RETRY
IGNORE
YES
NO
CANCEL
YES
 
NO

No ICON
0
1
2
3
4

Stop Sign
16
17
18
19
20

Question Mark
32
33
34
35
36

Exclamation Mark
48
49
50
51
52

Information Symbol
64
65
66
67
68


	If FOXTOOLS.FLL is not available on your system or you are using the DOS version of 
FoxPro all of the menu numbers in the chart above are valid but no icons will ever 
display.



	
It is a standard convention in Windows for the title of the Window displayed by 
Dialog( ) to reflect the name of your application.  The memory variable m.gcSystem 
holds the name of your application and can be used as the specification for <expC2> 
when calling the function Dialog( ).


Example	This example presents the standard dialog number 33 with OK and CANCEL buttons and 
a Question Mark icon. 

IF Dialog(Is the PRINTER Ready?, m.gcSystem,33) = OK
		LIST STRU TO PRINT
	ELSE
		LIST STRU
	ENDIF
 



DimNav
Purpose	Dims (greys-out) control panel navigational buttons as appropriate . 
Syntax	DimNav( )
See Also	On_Off
Description	DimNav will automatically dim (grey-out) the navigational buttons TOP, NEXT, 
BOTTOM and PREVIOUS as appropriate.  For example, when the current table/.DBF is 
at the last record then it is apprpriate for the BOTTOM and NEXT navigational buttons 
to be dimmed.

DimNav also turns the buttons back on as dictated by the environment. 
Example	


DoChild
Purpose	Invokes a child screen program that is a full featured data entry screen. 
Syntax	DoChild( <expC> )
Parameters	<expC>	specifies the name of the child screen program to invoke.
See Also	MenuHit, SprSetup
Description	DoChild will invoke the Full Featured Data Screen that is passed to it as a child of the 
currently active window. 



Edit_Chk( )
Purpose	Returns .T. if an edit is taking place in the sub-window specified.
Syntax	Edit_Chk( <expC> )
Parameters	<expC>	specifies the name of the sub-window to check.
See Also	SubEdit
Description	Edit_Chk( ) returns .T. if an edit is taking place in the window specified.  It is called by 
and it is a subserviant routine to SubEdit.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


EditRec
Purpose	Places the user into edit mode for the current record in the current table/.DBF..
Syntax	DO EditRec
See Also	AddRec
Description	EditRec places the user into edit mode for the current record in the current table/.DBF.  
If the record pointer is not positioned on a record then a message saying no records to 
edit appears.

If the record is successfully locked the user is then placed in the edit.  If the lock fails 
then a message is displayed indicating that an EDIT is not possible at this time.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.



EmptyDBF( )
Purpose	Returns .T. if there are NOT any records in a table.
Syntax	EmptyDBF( )
Returns	Logical
	
Description	This routine will return .T. if there are no records in the currently selected table.  It will 
not count records that have been DELETEd but not PACKd.

 modification to a FoxExpress application.
Example	This example XXX.




Encrypt( )
Purpose	Performs an encryption/unencryption on a character string
Syntax	Encrypt( <expC1>, <expC2>, <expL> ) 
Parameters	<expC1> The character string to encrypt
<expC2> The one character key to use for encryption
<expL>  Encrypt or unencrypt the character string
	 If  .T. then encrypt the string
	 If .F. then unencrypt the string 
Returns	Character 	
See Also	Fixmemo, Tamper
Description	Encrypt( ) will encrypt or unencrypt a character string using a one character key to 
perform the operation.
Parameters	<expC1>
The character string to be encrypted or unencrypted. 
<expC2>
The one character key to use for encryption
<expL>
Indicates whether encryption or unencryption is desired.  If .T. is specified then 
encryption takes place.  If .F. is specified then unencryption takes place.

Example	This example encrypts a customers credit card PIN number before calling another 
routine to return the encrypted value to the credit bureau.  
	
	m.EncrPin = Encrypt(ALLTRIM(m.Pin), CHR(20),.T.) 
DO sendpin WITH m.EncrPin 


ErrHandl
Purpose	The ON ERROR routine for all FoxExpress applications.
Syntax	DO ErrHandl WITH <expC1>, <expN1>, <expC2>, 
	    <expC3>, <expN2>, <expC4>,
	    <expC5>
Parameters	<expC1> The FoxPro PROGRAM( ) function.
<expN1> The FoxPro ERROR( ) function.
<expC2> The FoxPro MESSAGE( ) function.
<expC3> The FoxPro MESSAGE(1) function
<expN2> The FoxPro LINENO( ) function
<expC4> The FoxPro SYS(16) function
<expC5> The FoxPro SYS(2018) function 	
	
Description	ErrHandl is the base ON ERROR routine for all FoxExpress applications.  It is also 
known as the error handler. 

The routine is currently set up to handle the following error conditions and recover from 
them if possible:

  System is unavailable
  Other user using same ID???
  Files are unavailable for operation
  File is locked
  Record is locked
  Exclusive open is required
  Not enough memory
	Depending on the nature of the error some conditions will be a dialog in which the user 
can Retry or Cancel or take other appropriate action.  Serious unrecoverable errors will 
terminate the application.
Parameters	<expC1>
Specify the name of the current program usually with the FoxPro PROGRAM( ) 
function. 

<expN1>
Specify the number of the error usually with the FoxPro ERROR( ) function.

<expC2>
Specify the error message usually with the FoxPro MESSAGE( ) function.

<expC3>
Specify the source code of the current program usually with the FoxPro MESSAGE(1) 
function.

<expN2>
Specify the line number of the failing instruction usually with the FoxPro LINENO( ) 
function.

<expC4>
Specify the executing program name usually with the FoxPro SYS(16) function.

<expC5>
Specify the error message parameter usually with the FoxPro SYS(2018) function.
Example	This example illustrates the code typically used by a FoxExpress application to issue the 
ON ERROR statement.
	
* Error Handling Routine
	* Should be established with the following code:
	ON ERROR DO errhandl WITH ;
		PROGRAM(), ;
		ERROR(), ;
		MESSAGE(), ;
		MESSAGE(1), ;
		LINENO(), ;
		SYS(16), ;
		SYS(2018)


ErrorAction
Purpose	Runs a dialog to allow the developer several options when an error is encountered
Syntax	DO ErrorAction
Note	This routine functions differently when the application is running in development mode.  
When the application is not running in development mode only routine LogError will be 
called.  
See Also	LogError
Description	ErrorAction will run a dialog to allow the developer several options when an error is 
encountered.  This routine will only call LogError is the application is not running 
development mode.
Example	


ErrorPopup
Purpose	Displays a popup that allows the developer to select an option after an error has occurred.
Syntax	DO ErrorPopup
See Also	
Description	


EvntHndlr( )
Purpose	The foundation READ for all FoxExpress applications, also known as the event handler.
Syntax	EvntHndlr( ) 
Returns	Logical 	
See Also	CtrlActi( ), CtrlDeac( ), CtrlValid( ), CtrlWhen( ), Menuhit, SprSetup, WindHndlr( )
Description	EvntHndlr is the foundation READ for all FoxExpress applications.  It is also known as 
the event handler. 

It starts by refreshing the main menu and  figuring out why program control has reached 
the foundation READ and acts on that reason.  Some possible reasons are: Quit was 
selected from the File menu, the user has requested to run a new screen program which is 
a request driven by MenuHit, the foremost window has changed and needs the screen 
program associated with it to be run again or there are no remaining screen programs 
found so the control panel is no longer needed and should be removed.
Example	This example illustrates the code typically used by a FoxExpress application to issue the 
Foundation READ.
	
READ VALID EvntHndlr()
	


FEConfig( )
Purpose	Returns the current setting of any of the parameters in the FoxExpress???FOXPRO??? 
configuration file
Syntax	FEConfig( <expC> ) 
Parameters	<expC> The parameter to return the setting of.
Returns	Character 	
See Also	
Description	FEConfig( ) will return the current setting of any of the parameters in the FoxExpress 
???FOXPRO??? configuration file.  If the specified parameter is not found then the null 
string is returned.
Parameters	<expC>
The parameter to return the setting of.
Example	This example ???  
	


FEJ( )
Purpose	Field level READ WHEN for a BROWSE in a FoxExpress application that uses JKEY.
Syntax	FEJ( ) 
Returns	Logical 	
See Also	FoxPro READ command
Description	FEJ( ) is field level READ WHEN clause for a BROWSE in a FoxExpress application 
that uses JKEY. 

Sets ORDER to the tag corresponding with the current field name to enable JKEY 
searching on that field in the BROWSE.  

A false is returned for fields with no matching tag name.
Example	This example ???  
	


FEQuit
Purpose	Quits a FoxExpress application.
Syntax	DO FEQuit
See Also	GetOut
Description	FEQuit is used to completely quit from a FoxExpress application.  

If Developer mode is turned is turned on then the application returns to FoxPro.  If 
Developer mode is not turned on then the application will quit FoxPro.
Example	
	


FilterDbf
Purpose	Displays a dialog allowing the user to set up a record filter for the current table/.DBF.
Syntax	DO FILTERDBF
See Also	FILTER.SPR
Description	Uses the generic filter dialog FILTER.SPR to set a filter criteria according to the users 
specifications.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


FindRec
Purpose	Displays a dialog for finding records in the current table/.DBF.
Syntax	DO FindRec
See Also	SEARCH.SPR, FINDER.PRG
Description	Uses the generic search dialog SEARCH.SPR to set up and search for records matching 
the users specifications.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


FirstRec
Purpose	Displays the first record in the current table/.DBF.
Syntax	DO Firstrec
See Also	LastRec, NextRec, PrevRec
Description	Selects and displays the first record in the current table/.DBF. If the current record is the 
first record in the table/.DBF a message is displayed.  This procedure works with Main 
screens and full featured data entry screens.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


FixMemo
Purpose	To replace the fields checkmemo and sum in the current record of the FoxExpress 
USERS database with updated proper values.
Syntax	DO FixMemo
See Also	Encrypt, Tamper
Description	FixMemo replaces the fields checkmemo and sum in the current record in the 
FoxExpress USERS database with updated proper values.

Field checkmemo should contain a concatenation of each of the values of all Table fields 
and the sum field should contain a checksum (SYS(2107)) of the memo field.  

A user cannot login to a FoxExpress application if these two values are not equal.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.




ffCleanUp
Purpose	Clean up code procedure for Full Featured Data Entry screens 
Syntax	ffCleanUp( )
See Also	ffDelete	
Description	Procedure ffCleanUp is the clean up code procedure for all Full Featured Data Entry 
screens in a FoxExpress application.  It stores the current record in WindHndlr( ) array.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


ffDelete
Purpose	Deletes the current record in the current table/.DBF, for Full Featured Data Entry screens, 
based on settings defined in the data dictionary for deletion and relational integrity. 
Syntax	ffDelete( )
See Also	ddDelete, DelRec
Description	ffDelete will attempt to delete the current record in the currently selected table/.DBF.  It 
will maintain parent/child relational integrity by following your specifications in the data 
dictionary.  

It is meant to work specifically with Full Featured Data Entry screens and is called by 
DelRec which is the preferable routine to use.   

If the record pointer is at the beginning or end of file a message will be displayed.  If the 
record cannot be locked a message will be displayed.

Example	This example tests for the existence of an array called rel_recs (indicating a Full Featured 
Data Entry screen) and calls ffDelete if this array exists.  If it does not exist (indicating a 
Main Data Entry screen) it calls ddDelete.  This code is taken directly from DelRec. 
 
IF TYPE("rel_recs[1]")<>"N"
		DO ddDelete
	ELSE
		DO ffDelete
	ENDIF


FrxView
Purpose	Displays a report to the screen.
Syntax	DO FrxView WITH <expC>
Parameters	<expC>	The name of the file that contains the report.
Note	DOS ONLY
See Also	
Description	This procedure will allow you to display a report on the screen.  The PREVIEW option in 
the report writer does not have the capability to scroll back pages but FrxView does 
making it the more flexible of the two.

This procedure is applicable to the DOS environment only. 

Parameters	<expC>
<expC> specifies the name of the file that contains the output of the report.
Example	This example displays the report called ACCOUNTS.TXT on the screen.

DO FrxView WITH ACCOUNTS.TXT



GetBlank( )
Purpose	Gets a new blank record by first trying to recycle a DELETED record and then if one is 
not available do the equivalent of APPEND BLANK.
Syntax	GetBlank( )
See Also	AddRec, ddInitRec
Description	This routine attempts to recycle a DELETED record and if not possible APPENDs a 
BLANK record.  
	This routine is not useful if your tables have not been defined with an INDEX on 
DELETED( ).  For more information see Defining Indexes on DELETED( ) in this 
manual.
Example	This example invokes GetBlank to add a new record.

IF GetBlank() = .T. 
	  ? Got one...
	ELSE
	  ? ERROR During GETBLANK()
	ENDIF



GetHelp
Purpose	Used to identify where the user is when help is asked for providing for context sensitive 
help.
Syntax	DO GetHelp WITH <expC1>, <expC2>,  <expC3>, <expN>
Parameters	<expC1> The FoxPro PROGRAM( ) function.
<expC2> The FoxPro WONTOP( ) function or the variable m.readwindow.
<expC3> The FoxPro VARREAD( ) function.
<expN1> The value of the variable _CUROBJ	
See Also	
Description	GetHelp identifies where the user is when help is asked for providing for context 
sensitive help and displays the appropriate record in the help file, if found,
Parameters	<expC1>
Specify the name of the current program usually with the FoxPro PROGRAM( ) 
function. 

<expC2>
Specify the variable m.readwindow or the FoxPro WONTOP( ) function.

<expC3>
Specify the FoxPro VARREAD( ) function.

<expN1>
Specify the FoxPro variable _CUROBJ.

Example	


GetOut
Purpose	Quits the entire application if the state of the present environment is OK to for it to do so.
Syntax	DO GetOut [WITH <expC>]
Parameters	<expC>	The applications name for display in shutdown dialog messages.
See Also	AddRec, ddInitRec
Description	This routine ensures that there are no remaining ADDs or EDITs waiting to be 
committed before displaying a shutdown option for the entire Application.  

If there currently is not any related window screen for an open parent window the routine 
will begin closing all windows that are not in an ADD or EDIT mode.  

If any screens are in an ADD or EDIT then the process will be stopped.  A dialog 
message is presented to the user giving them the option to exit the application.
Parameters	<expC>
<expC> specifies the name of the application as you want it displayed in dialog message 
during the shutdown of the application.  If you do not specify <expC1> it defaults to the 
name of the FoxExpress application, variable m.gcSystem..
Example	This example exits the application.

DO GetOut WITH Customer Application



GetSize( )
Purpose	Returns the current size of the memory variable m.lcTempField which is used to store 
the value of the condition in the generic procedure Finder.
Syntax	GetSize( )
Return	Numeric
See Also	Finder
Description	This routine returns the current size of the memory variable m.lcTempField which is 
used to store the value of the condition in the generic procedure Finder.  This memory 
variable can end up being any variable type which is what makes this procedure 
necessary.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.



GetSubs( )
Purpose	Returns a list of open child windows for the specified parent window.
Syntax	GetSubs( <expC> )
Parameters	<expC>	The name of the parent window.
Returns	Character  	
See Also	 	
Description	GetSubs( ) returns a comma delimited list of all open child windows of the parent 
window you specify.  If there are no child windows open a null string is returned.

Parameters	<expC>
<expC> is the name of the parent window.
Example	This example checks to see if a child window named INVOICES exists for the parent 
window named CUSTOMER.

m.Children = GetSubs(customer)
IF AT(INVOICES,UPPER(m.Children))
  ? Child screen INVOICES exists
ELSE
  ? Child screen INVOICES does not exist
ENDIF


GoRecNo
Purpose	Resets the record pointer for the current table/DBF to the record number passed.
Syntax	DO GoRecNo WITH <expN>
Parameters	<expN>	The record number to go to.
See Also	
Description	This routine will reset the record pointer for the current table/DBF to the record number 
passed, if it is a valid record number.  If it is not a valid record number a LOCATE is 
done.
Parameters	<expN>
<expN> specifies the record number in the current table/DBF that you want to go to.
Example	This example restores the current record from the record number saved in the 
windhandlr( ) array.

DO GoRecNo WITH WindHandlr[m.array_row,3]


HelpOn
Purpose	This function is designed to avoid errors with dialogs that are used by both FoxExpress 
and the generated application.  It does not do anything if you call it.
Note	This function is designed to fake out the FoxPro project manager for the purpose of 
compatibility with your FoxExpress applications..
See Also	Rel_Recs( ), WindHndlr( )	
Description	This routines purpose relates to the project manager in FoxPro and integration issues for 
FoxExpress.  It does nothing if you call it.


IfTag( )
Purpose	Returns .T. if the specified tag exists.
Syntax	IfTag(<expC>)
Parameters	<expC>	The tag name you are checking for.
Returns	Logical  	
See Also	
Description	Returns .T. if the specified tag exists.

Parameters	<expC>
<expC> the name of the tag you are checking for.
Example	This example checks to see if a tag exists named deleted.

IF NOT IfTag("deleted")
  ? Cannot find index on DELETED()
ENDIF


Increment( )
Purpose	Called by Rollover to get the next sequential value for a character position in a generated 
key.  
Syntax	Increment(<expC>, <expN>)
Parameters	<expC>	The character string to increment
<expN>	The character position to be incremented
Returns	Character  	
See Also	ddGenKey, Rollover
Description	Increments one character position in a character string to the next sequential character.  If 
the character position to be incremented is at maximum (Z for an alpha position or 9 
for a digit position) then the character is not incremented.

 This routine is called by Rollover which is in turn called by ddGenKey.

Parameters	<expC>
<expC> the character string to be incremented
<expN> the character position in the string to be incremented
Example	This example increments the sixth position of the string key.

lckey = 000078
lcNewKey = INCREMENT(lcKey,6)


IsDir( )
Purpose	Returns .T. if the specified directory exists.
Syntax	IsDir(<expC>)
Parameters	<expC>	The directory you are checking for.
Returns	Logical  	
See Also	
Description	Returns .T. if the specified directory exists.

Parameters	<expC>
<expC> the name of the directory you are checking for.
Example	This example checks to see if a directory exists named \foxprow\express.

gcHomeDir = \foxprow\express
glItsThere = ISDIR(gcHomeDir)
if NOT glItsThere
  ? Cannot find HOME directory
endif



IsExclusive( )
Purpose	Returns .T. if the user currently has exclusive control of the table in the current work 
area.
Syntax	IsExclusive( )
Returns	Logical  	
See Also	IsFlocked( ), IsRlocked( )
Description	Returns .T. if the user currently has exclusive control of the table in the current work 
area.
Example	This example checks if the user currently has exclusive control.

IF NOT IsExclusive( )
  ? Cannot run MAINTENANCE jobs...No EXCLUSIVE control
ELSE
  DO dbfmaint
ENDIF



IsFLocked( )
Purpose	Returns .T. if the user currently has a file lock or exclusive control of the table in the 
current work area.
Syntax	IsFLocked( )
Returns	Logical  	
See Also	IsExclusive( ), IsRLocked( )
Description	Returns .T. if the user currently has a file lock or exclusive control of the table in the 
current work area.
Example	This example checks if the user currently has a file lock or exclusive control.

IF NOT IsFLocked( )
  ? Cannot run YEAR END jobs...File is not LOCKED
ELSE
  DO yearend
ENDIF



IsPopup( )
Purpose	Returns .T. if the specified menu popup exists.
Syntax	IsPopup( <expC> )
Parameters	<expC> the name of the menu popup to check.  	
Returns	Logical  	
See Also	
Description	Returns .T. if the the specified menu popup exists.

Parameters	<expC>
<expC> the name of the menu popup to check.
Example	This example checks to see if the menu popup named WINDOW exists.

llWindow = IsPopup(WINDOW)


IsRLocked( )
Purpose	Returns .T. if the user currently has a record lock, a file lock or exclusive control of the 
table in the current work area.
Syntax	IsRLocked( )
Returns	Logical  	
See Also	IsExclusive( ), IsFLocked( )
Description	Returns .T. if the user currently has a record lock, a file lock or exclusive control of the 
table in the current work area.

Example	This example checks if the user currently has a record lock, file lock or exclusive control.

IF NOT IsRLocked( )
  ? Cannot EDIT record...Record is not LOCKED
ELSE
  DO EDITREC
ENDIF



LastRec
Purpose	Displays the last record in the current table/.DBF.
Syntax	LastRec
See Also	FirstRec, NextRec, PrevRec
Description	Selects and displays the last record in the current table/.DBF.  If the current record is the 
last record in the table/.DBF a message is displayed.  This procedure works with Main 
screens and Full Featured Data Entry screens.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


ListActn( )
Purpose	READ VALID clause for the MORE, SAVE and CANCEL buttons in all list data entry 
screens.
Syntax	ListActn( <expC> )
Parameters	<expC>	The action to perform, either MORE, SAVE or CANCEL. 
Returns	Numeric, always 0.  	
See Also	CnclWhat, ListCancel, ListRval, ListVal
Description	ListActn is the VALID clause for the MORE, SAVE and CANCEL buttons in all list data 
entry screens in a FoxExpress application.  It acts upon the current child table/.DBF that 
is open in the list data entry screen and performs the action (MORE, SAVE or CANCEL) 
that is passed to it.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


ListCancel( )
Purpose	Determines what is to be canceled and cancels it when CANCEL is selected in a list data 
entry screen.
Syntax	ListCancel( <expC> )
Parameters	<expC>	A description of the item to be canceled. 
Returns	Logical.  	
See Also	CnclWhat, ListRval, ListVal
Description	ListCancel is called by ListActn to determine what state the list data entry screen is in 
when CANCEL is selected, determine what is to be canceled and cancel it.

It calls CnclWhat to ask the user what they wish to cancel NONE, ALL or the LAST 
record entered.  Then based on the return from CnclWhat it cancels the appropriate item.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


ListRVal( )
Purpose	READ VALID clause for subscreen lists that are MODAL the purpose of which is to 
perform a cancel if the user presses ESC from within one of these subscreens..
Syntax	ListRVal( <expC> )
Parameters	<expC>	A description of the item that will be canceled. 
Returns	Logical.  	
See Also	CnclWhat, ListCancel, ListVal
Description	ListRVal is the READ VALID clause for subscreen lists that are MODAL the purpose of 
which is to perform a cancel if the user presses ESC from within one of these subscreens.

If the ESC has been pressed then this routine calls ListCancel.  If the user chooses 
CANCEL during ListCancel then true is returned and the read is terminated.  Otherwise 
false is returned and the read is not terminated.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


ListShow( )
Purpose	READ SHOW clause for related record list objects, enables and disables the screen 
objects as appropriate.
Syntax	ListShow( <expC1>, < array >, < expN >,  <expC2> )
Parameters	<expC1>	Name of the key field in the parent table
<array>		Items in list passed in array by reference
<expN> 	Line Number variable passed by reference
<expC2> 	Variable used in push buttons. 
See Also	CnclWhat, ListCancel, ListVal, FoxPro READ command
Description	ListShow is the READ SHOW clause for related record lists.  Its main function is to 
enable and disable different screen objects that are associated with the list as appropriate 
by the current environment.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
SHOW clause.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


ListVal( )
Purpose	READ VALID clause for the NEW, CHANGE and REMOVE button set found on 
scrolling list screens.
Syntax	ListVal( <expC> )
Parameters	<array>	An array containing the records for the list. 
Returns	Logical.  	
See Also	CnclWhat, ListCancel, ListRVal
Description	ListVal is the READ VALID clause for the NEW, CHANGE and REMOVE button set 
found on scrolling list screens.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


MenuHit
Purpose	Launches a new screen program so that it will be hooked into the event handler
Syntax	DO MenuHit WITH <expC>
Parameters	<expC>	The screen program to execute with the .spr extension included.
See Also	EvntHndlr( ) 
Description	MenuHit is used to launch a new screen program so that it will be hooked into the event 
handler. 

If an application READ is already active when MenuHit is called (one or more other 
application screen programs are active) a CLEAR READ is executed.  This causes the 
active application READ to terminate as soon as the menu processing routine (which 
called MenuHit) is complete.  The CLEAR READ also requests that the foundation 
READ be terminated. 

The active application READ terminates first and control passes back to the foundation 
READ.  Since the foundation READ has also been CLEARed, its VALID routine is 
executed which is always the procedure EvntHndlr.  This procedure upon being driven 
notes that the variable nextprog has been assigned a value and launches the new screen 
program that is contained in that variable.

If no application READ is active when MenuHit is called, then MenuHit simply executes 
the screen program directly.
Example	This example calls MenuHit to launch the screen program CUSTOMER.SPR
 
DO MenuHit WITH CUSTOMER.SPR


ModalVal( )
Purpose	READ VALID routine for most modal screens in a FoxExpress application.
Syntax	ModalVal( )
Returns	Logical
See Also	FoxPro READ command
Description	ModalVal is the READ VALID routine for most modal screens in a FoxExpress 
application.  It checks to see if the modal screens READ has terminated implicitly 
because of a time-out and if so it calls procedure ScrnSvr.  In any other case the READ 
has been terminated explicitly and the routine completes the termination of the READ.

Please refer to your FoxPro documentation for more information on the FoxPro READ 
VALID clause.


MVar2Array
Purpose	Copies the variables in an active add or edit window to an array when the window is 
deactivated so that the variables can later be restored.  
Syntax	DO MVar2Array
See Also	Array2MVar, ScreenOut
Description	For a FoxExpress application to be able to provide the user with multiple add and edit 
windows that are open simultaneously, it is necessary to save the current contents of the 
edit fields when the user deactivates a window with an active add or edit before 
committing the EDITs.  FoxExpress handles this by saving the field values into an array.
	MVar2Array will copy the memory variables for a given screen to an array based on the 
value of the variable m.array_row.  Before this procedure is called m.array_row should 
point at the row of the winhndlr array that corresponds to the window being deactivated.  
MVar2Array works together with Array2MVar. 
Example	Save the contents of the memory variables for application window number 2.
 
m.array_row = 2
DO MVar2Array()


NextRec
Purpose	Displays the next record in the current table/.DBF.
Syntax	DO NextRec
See Also	FirstRec, LastRec, PrevRec
Description	Selects and displays the next record in the current table/.DBF.  If the current record is the 
last record in the table/.DBF an error message is displayed.  This procedure works with 
Main screens and full featured data entry screens.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


NoExt( )
Purpose	Returns a file name with the three character extension removed.
Syntax	NoExt(<expC>)
Parameters	<expC>	The file name to strip the extension off of.
Returns	Character  	
See Also	IsDir( ), NoPath( )
Description	Returns the file name passed to it with the three character extension (if there is one) 
stripped off.

Parameters	<expC>
<expC> the file name to strip the extension off of.
Example	This example removes the extension from the file name CUSTOMER.DBF for use in 
other commands.

gcFileName = CUSTOMER.DBF
gcFile = NoExt(gcFileName)
IF USED(gcFile)
  SELECT (gcFile)
ELSE
  SELECT 0
  USE (gcFile)
ENDIF


NoPath( )
Purpose	Returns a file name with the preceding path name removed.
Syntax	NoPath(<expC>)
Parameters	<expC>	The file name to strip the path off of.
Returns	Character  	
See Also	IsDir( ), NoExt( )
Description	Returns the file name that was passed to it with the preceding path name (if there is one) 
stripped off.

Parameters	<expC>
<expC> the file name to strip the path off of.
Example	This example removes the path from the file name \FOXPROW\CUSTOMER.DBF.

gcPathFile = \FOXPROW\CUSTOMER.DBF
gcFileName = NoPath(gcPathFile)
gcFile = NoExt(gcFileName)
IF USED(gcFile)
  SELECT (gcFile)
ELSE
  SELECT 0
  USE (gcFile)
ENDIF


OrderDbf
Purpose	Allows the user to select the order of the current table/.DBF from the TAGs defined in 
the data dictionary.
Syntax	DO OrderDbf
See Also	 
Description	Allows the user to select the order of the current table/.DBF.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


PackDbfs 
Purpose	Invokes a dialog that allows the user to select from tables defined in the data dictionary 
one or more that they wish to have PACKed.
Syntax	DO PackDbfs
See Also	ReIndexer
Description	Presents the user with a list of all tables defined in the data dictionary from which they 
can select one or more to have PACKed.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.




PageBtns( )
Purpose	READ VALID for multi-page data entry screens used to handle switching between the 
screens.
Syntax	PageBtns( )
Returns	Logical, always .T.  	
See Also	
Description	This routine is the READ VALID for multi-page data entry screens and is used to handle 
switching between the screens.  Driven by the page button which is pressed by the user 
the appropriate page window is selected and the page buttons on the new window are 
activated.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.  


Parent( )
Purpose	Returns the names of all tables which are parents in a relation with the currently selected 
table/.DBF.
Syntax	Parent( )
Returns	Character, a list of all the parent tables comma delimited  	
See Also	
Description	Returns a comma delimited list of all tables that are parents in a relation to the currently 
selected table/.DBF.  This is without regard to definitions in the data dictionary; the list 
that is returned is of currently related tables.
Example	This example prints out the names of each of the tables that is currently a parent in 
relation to the table INVOICE.

SELECT invoice
gcList = Parent( )
IF NOT EMPTY(gcList)
  IF AT(,, gcList) = 0 
    ? gcList
  ELSE
    gnPos = 0 
    FOR I = 1 to OCCURS(,,gcList)
      ? SUBSTR(gcList, gnPos, len(gcList) - at(,,gcList, I))
      gnPos =  at(,,gcList, I) + 1
    ENDFOR
  ENDIF
ENDIF


PDSetup
Purpose	Invokes a dialog that allows the user to select a default printer from the available 
installed drivers. Calls PRINTER.SPR  to bring forward the appropriate dialog, based on 
the current platform. 
Syntax	DO PdSetup
See Also	THERM
Description	PDSetup calls PRINTER.SPR to bring forward the appropriate default printer dialog 
depending on the current environment.  

If Windows is the current environment, a standard Windows library routine presents the 
user with a list of all the printers that are currently installed.  The user selects one of them 
as the default printer.  They can also configure the various options available for the given 
print driver. This dialog is far more robust than even the standard Print Setup dialog that 
is incorporated into FoxPro for Windows.

In DOS, the user is allowed to select from the pre-defined printer drivers.
Example	This example calls PDSetup providing the user with the dialog shown below.
 

DO PDSetup




PrevRec
Purpose	Displays the previous record in the current table/.DBF.
Syntax	DO PrevRec
See Also	FirstRec, LastRec, PrevRec
Description	Selects and displays the previous record in the current table/.DBF.  If the current record 
is the first record in the table/.DBF a message is displayed.  This procedure works with 
Main screens and Full Featured Data Entry screens.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.


Ready2Pr( )
Purpose	Returns .T. if the printer is READY and .F. if it is NOT READY.  Also gives the user a 
chance to retry the printer if it is NOT READY.
Syntax	Ready2Pr( )
Returns	Character  	
See Also	
Description	If the printer is READY .T. is returned.  If it is NOT READY .F. is returned.  This 
routine makes use of the FoxPro function PRINTSTATUS( ) but goes further by offering 
the user an opportunity to correct the NOT READY condition of the printer.  
Example	This example checks to see if the currently selected printer is READY and if it is a LIST 
TO PRINT is executed.  If it is NOT READY then a LIST PREVIEW is done.

IF Ready2Pr( )
  LIST FOR customer.balance > 100 TO PRINT
ELSE
  LIST FOR customer.balance > 100 PREVIEW
ENDIF
  


Reindexer
Purpose	Invokes a dialog that allows the user to select from tables defined in the data dictionary 
one or more that they wish to have the indexes rebuilt for.
Syntax	DO Reindexer
See Also	PackDbfs
Description	Presents the user with a list of all tables defined in the data dictionary from which they 
can select one or more to have the indexes rebuilt for.

Each selected table will have its indexes rebuilt from scratch based on the definitions in 
the Data Dictionary.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


Rel_Recs( )
Purpose	Does not do anything if you call it but it will always return .T.
Note	This function is designed to fake out the FoxPro project manager for the purpose of 
compatibility with your FoxExpress applications..
See Also	HelpOn, WindHandlr( )
Description	This routines purpose relates to the project manager in FoxPro and integration issues for 
FoxExpress. 

This function works around a problem with the FoxPro project manager not respecting 
the EXTERNAL command for the array windhndlr.
 
It does nothing if you call it.


Rest_Env( )
Purpose	Restores the entire environment from a passed array that was created with Save_Env.
Syntax	Rest_Env( <array> )
Parameters	<array> An array passed by reference to restore the environment from.
See Also	Save_Env
Description	Rest_Env will restore the following information from an array created by Save_Env:
	Table/.DBF name
Alias
Relations
Index tag name
Record Number
	You should pass by reference an array that was created by Save_Env. 
Parameters	<array>
<array> an array passed by reference that was created by Save_Env
Example	This example uses Save_Env to save the current environment in advance of doing some 
processing that has not been fully integrated into the FoxExpress environment.

DIMENSION laEnvironment[1,5]
=Save_Env(@laEnvironment)
DO external.prg
=Rest_Env(@laEnvironment)


Save_Env
Purpose	Saves the entire current environment to an array.
Syntax	Save_Env( <array> )
Parameters	<array> An array passed by reference to save the entire current environment in.
See Also	Rest_Env
Description	Save_Env will save into an array the following information for each table/.DBF that is 
currently open:
	Table/.DBF name
Alias
Relations
Index tag name
Record Number
	This array can be passed to procedure Rest_Env to restore the saved environment.

You should pass by reference an array with 1 row and 5 columns.  The routine will add 
rows to the array for each of the currently active work areas.
 
Parameters	<array>
<array> an array passed by reference with 1 row and 5 columns
Example	This example uses Save_Env to save the current environment in advance of doing some 
processing that has not been fully integrated into the FoxExpress environment.

DIMENSION laEnvironment[1,5]
=Save_Env(@laEnvironment)
DO EXTERNAL.PRG
=Rest_Env(@laEnvironment)


ScreenOut
Purpose	Maintains the current screen environment when another screen has been made the active 
screen or cleans up after a screen that has been closed entirely.
Syntax	ScreenOut
See Also	Array2MVar, MVar2Array
Description	ScreenOut will save and maintain the environment of the current screen when it is no 
longer the active screen (i.e. another screen has become the active screen).

If the screen that is being exited is currently in an active add or edit then procedure 
MVar2Array is called to save the variables the screen was using for editing into a public 
array.  This is so that the value of those memory variables can be recalled with 
Array2MVar when the user reenters the screen.  If the screen is part of a multiple page 
data entry setup then the other pages of the data entry screen are deactivated.

If the screen is being closed entirely then any dependent child windows are also closed. If 
this is the screen is being closed entirely and it the last active screen then the control 
panel is deactivated too.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application. 


ScrnDbf( )
Purpose	Selects the Table that is associated with a given window.
Syntax	ScrnDbf( <expC> )
Parameters	<expC> The name of the window whose associated table/.DBF is to be selected.
See Also	FoxPro READ command
Description	ScrnDbf will select the table/.DBF that is associated with the window that it is passed to 
it.  

Most times you will pass the value that is in variable m.readwindow.  The sixth column 
of the windhndlr array  holds the alias for the table/.DBF and the actual table/.DBF 
name separated by a colon and a space.  This information is stored to the array in the 
function CtrlWhen( ), which is used as the READ WHEN clause on the control panel.
Parameters	<expC>
<expC> specifies the name of the window whose associated table is to be selected.
Example	This example calls ScrnDbf to ensure that the appropriate table/.DBF for the current 
screen is selected.  The value of m.readwindow is already set to the current window.

*Ensure the proper DBF is selected
=ScrnDbf(m.readwindow)


ShiftL( )
Purpose	Shifts a value a specified number of times to the left
Syntax	ShiftL( <expN1>, <expN2> )
Parameters	<expN1> The value to be shifted 
<expN2> The number of times to shift the value 
Returns	Numeric  	
See Also	ShiftR( )
Description	ShiftL( ) will shift a value to the left a specified number of times.  It is not really a true 
mathematical shift because the value will continue to be extended through multiple shifts.
Parameters	<expN1>
<expN1> specifies the value to be shifted.
<expN2>
<expN2> specifies the number of times to shift the value.
Example	This example calls SHIFTL to shift the value of the current month and the current year 
into higher digit positions so that the day, month and year can be placed into one numeric 
variable for use in a time stamp.  This example is from procedure StampVal.

m.dateval = DAY(DATE()) + ;
		ShiftL(MONTH(DATE()), 5) + ;
		ShiftL(YEAR(DATE())-1980, 9)


ShiftR( )
Purpose	Shifts a value a specified number of times to the right
Syntax	ShiftR( <expN1>, <expN2> )
Parameters	<expN1> The value to be shifted 
<expN2> The number of times to shift the value 
Returns	Numeric  	
See Also	ShiftL
Description	ShiftR( ) will shift a value to the right a specified number of times.  It is not really a true 
mathematical shift because the value will continue to be extended through multiple shifts 
without truncation.
Parameters	<expN1>
<expN1> specifies the value to be shifted.
<expN2>
<expN2> specifies the number of times to shift the value.
Example	This example calls SHIFTR to shift the seconds portion of the current time value into 
lower digit positions so that the hours, minutes and seconds can be placed into one 
numeric variable for use in a time stamp.  This example is from procedure STAMPVAL.

m.timeval = SHIFTR(VAL(RIGHT(TIME(),2)),1) + ;
		ShiftL(VAL(SUBSTR(TIME(),3,2)),5) + ;
		ShiftL(VAL(LEFT(TIME(),2)),11)


SprSetup
Purpose	Sets up a screen for use with the event handler. 
Syntax	SprSetup( <expC> )
Parameters	<expC> the name of the main window in the screen set
See Also	EvntHndlr
Description	SprSetup will set up a screen for use with the event handler.  An additional row is added 
to the windhandlr array for the new screen and each of the columns in the array are 
initialized for the new screen program.  Add2Menu is called to add the name of the new 
window as a pad on the WINDOW menu bar.

An example is not provided because all necessary uses of this routine are automatically 
inserted by FoxExpress.  It is unlikely that you would ever use this routine in making 
modification to a FoxExpress application.   


StampVal( )
Purpose	Returns a date and time stamp value
Syntax	StampVal( )
Returns	Numeric  	
See Also	ShiftL( ), ShiftR( )
Description	StampVal( ) will return a the current date and time as a single numeric time stamp value. 
Example	This example calls StampVal( ) to mark the current record with a time stamp to indicate 
when it was last updated.

m.now = StampVal( )


Status
Purpose	Displays a status message for the user.
Syntax	DO Status WITH <expC>
Parameters	<expC>	The message to display in the status window
See Also	Dialog( ), StatusOff, Therm
Description	STATUS displays a message for the user.  This can be used for any purpose you might 
have such as informing the user about what type of processing is currently taking place.

A FoxPro WAIT WINDOW command is issued with the message you specify and the 
NOWAIT option. 

Parameters	<expC>
<expC> specifies the message to display in the status window.
Example	This example calls STATUS to indicate to the user that a report is currently being 
generated.

DO Status WITH "Generating Report"
DO REPORT.QPR


StatusOff
Purpose	Deactivates and releases a message window created with Status.
Syntax	DO StatusOff
See Also	Status
Description	StatusOff deactivates and releases a window created by Status using WAIT CLEAR.
Example	This example uses STATUSOFF to deactivate and release a window already created by 
STATUS.

DO Status WITH "Generating Report"
DO REPORT.QPR
DO StatusOff


SubEdit( )
Purpose	Returns true if the user has an active add or edit in a dependent child window of the 
parent window specified.
Syntax	SubEdit( <expC> )
Parameters	<expC> The name of the parent window to check the child windows of.
See Also	Edit_Chk
Description	SubEdit( ) will return .T. if the user has an active add or edit in a dependent child 
window of the parent window specified.

It makes repeated calls to Edit_Chk to check every dependent window that is open.
Example	This example checks to see if an edit or add is taking place in any dependent child 
window and displays a message if it is. 

IF SubEdit()
		WAIT WINDOW Editing in child window
	ENDIF


TempName( )
Purpose	Returns a unique temporary file name.
Syntax	TempName( <expC> )
Parameters	<expC>	The three character extension to append to the file name.
Returns	Character  	
See Also	
Description	TempName( ) generates a unique temporary file name using FoxPros SYS(3) function.  
The extension which is passed to this routine is then appended to the generated name.

The routine also checks to make sure that there is not already a file with the name 
generated by the call to SYS(3).  If such a file already exists then another call is made to 
SYS(3) until a truly unique name is found.

Parameters	<expC>
<expC> the three character file extension to be appended to the end of the generated file 
name.	
Example	This example calls TempName( ) to generate a file name.

m.lcFileName=TempName("TMP")


Therm
Purpose	Displays a thermometer.
Syntax	DO Therm WITH <expC>, <expN1>, <expN2>
Parameters	<expC>		The message to display in the thermometer window
<expN1> 	The total number of items to process
<expN2>	The number of items that have been processed at this point
See Also	Dialog( ), Status
Description	Therm displays a thermometer style window and allows for repeated updating of the 
thermometer as progress continues.  It is included as an additional line of code in any 
loop.

Parameters	<expC>
<expC> specifies the message to display in the thermometer window.
	<expN1>
<expN1> specifies the total number of items to be processed (or iterations of the loop to 
be performed).
	<expN2>
<expN2> specifies the number of items that have been processed at this point. 

Example	This example calls Therm repeatedly during a loop through each of the records in this 
table.

USE Customer
DO WHILE NOT EOF()
	  DO Therm WITH Turning BATCH flag off...,RECCOUNT(), RECNO()
	  REPLACE batch WITH .f.
	  SKIP
	ENDDO

 


URand( )
Purpose	Returns a uniformly distributed random real number between two values that you 
specify.
Syntax	URand( <expN1>, <expN2> )
Parameters	<expN1> The bottom end of the range for generating a random number within 
<expN2> The top end of the range for generating a random number within 
Returns	Numeric  	
See Also	
Description	URand will generate a uniformly distributed random number that is within the range that 
you specify. Portions of this code were taken from the FoxPro Help File.

Parameters	<expN1>
<expN1> specifies the bottom end of the range
<expN2>
<expN2> specifies the top end of the range
Example	This example will return a random number between 10 and 35.

m.rnum = URand(10,35)


UserMsg
Purpose	Displays a message window on the screen.
Syntax	UserMsg( <expC>, <expN> )
Parameters	<expC> The message to display in the window 
<expN> The upper left corner for positioning of the window 
See Also	UserMsg2
Description	UserMsg will display your specified message in a window on the screen at the location 
you specify.  The window is sized according to the size of the message.

The window must be deactivated and released in the calling program.
Parameters	<expC>
<expC> specifies the message to display in the window
<expN>
<expN> specifies the upper left corner for positioning of the window
Example	This example will display a informational message before taking the user into an edit of 
their own CONFIG.SYS .

DO UserMsg WITH Edit CONFIG.SYS to your satisfaction,SROWS()-3
MODIFY FILE C:\CONFIG.SYS WINDOW configuration
RELEASE WINDOW configuration
RELEASE WINDOW usermsg 



WasChanged( )
Purpose	Returns .T. if any of the current database fields do not equal the corresponding named 
memory variable.  Used to determine if data was changed during an edit.
Syntax	WasChanged( )
Returns	Logical  	
See Also	
Description	Returns .T. if any of the current database fields do not equal the corresponding named 
memory variable.  Used to determine if data was changed during an edit.



WindHndlr( )
Purpose	Does not do anything if you call it but will always return .T.
Note	This function is designed to fake out the FoxPro project manager for the purpose of 
compatibility with your FoxExpress applications..
See Also	HelpOn, Rel_Recs( )
Description	This routines purpose relates to the project manager in FoxPro and integration issues for 
FoxExpress. 

The array windhndlr is used for the event handler.  The project manager does not know 
this is an array when building.

This routine does nothing if you call it.  It will always return .T.


                              DDUNIQUE            
                              ISUNIQUE            
Data Dictionary
            	DDDELETE            
			DDJBLOOK            
	            ddOpen              
	            ddList              
	            ddgetfields         
	            ddgetname           
	            ddGenKey            
	            rollover            
	            increment           
	            ddPrompt            
	            ddValid             
	            ddWhen              
	            ddError             
	            ddMessage           
			ddBrowse            
	            ddLookUp            
	            ddGetPict           
	            ddRequired          
	            ddDbfNames          
	            ddHas               
	            ddInitRec           
	            ddGetJoins          
	            JunkRec             
	            ddShow              
Error Handler
	            ERRHANDL            
	            ErrorAction         
	            LogError            
	            ErrorPopup          
Event Handler
	            evnthndlr           
	            menuhit             
	            ctrldeac            
	            ctrlvalid           
	            ctrlwhen            
	            ctrlacti            
	            ctrlsetup           
	            SprSetup            
	            ScreenOut           
	            mvar2array          
	            array2mvar          
	            modalval            
	            doChild             
	            invisible           
	            ctrlshow            
	            DimNav              
FE Utility
                  RUN_SQL             
			btnmsg1             
	            getpval             
	            getsubs             
	            OpenTable           
	            bldfndstr           
	            pagebtns            
	            gofindit            
	            findmsg             
	            getsize             
	            PickAnswer          
	            PrintSetup          
	            DelMain             

Full Featured Data Entry Proc 
			FFDelete            
			ffCleanUp           
			ParentAdd           
			Go_FF_Eof           

Interface Utility
	            DIALOG              
			ABOUT               
			add2Menu            
			releasebar          
			STATUS              
	            statusoff           
	            ctrlline            
	            scrnsvr             
	            therm               
	            finder              
	            frxview             
	            usermsg             
	            on_off              
	            killwindow          
JKEY              
	            FEJ                 
	            JKeyInit            
	            JkeyCanc            
List Procedure
	            listactn            
			listval             
			listcancel          
			listrval            
			listshow            
			isrlocked           
Multi-user
                  isflocked           
			isexclusive         
Security
                  ENCRYPT             
			fixmemo             
	            checksec            
	            tamper              
	            login               
	            chngpwrd            
	            SetSecurity         
Utility           
	            GETHELP             
	            ASEARCH             
	            IsPopup             
	            ready2pr            
	            tempname            
	            getblank            
	            getout              
			nopath              
			noext               
	            urand               
	            isdir               
	            packdbfs            
	            parent              
	            scrndbf             
	            subedit             
	            edit_chk            
	            rel_subs            
	            PDSETUP             
	            stampval            
	            shiftl              
	            shiftr              
	            iftag               
			save_env            
	            rest_env            
	            goRecno             
	            showgets            
	            resetdbf            
	            DelList             
	            Reindexer           
	            OpenDbfs            
	            ShowBmp             
			EmptyDbf            
	            WasChanged          
	            SprMode             
	            CharMode            
	            FEConfig            
	            FEQuit              

Project Manager Fakeout   
			windhndlr           
			rel_recs            
			helpon              
 
 







FoxExpress Complete Reference
Draft - Wednesday, October 19, 1994		Internal Use Only








FoxExpress Complete Reference
Draft - Monday, October 10, 1994		Internal Use Only


