General & System

Top  Previous  Next

 

These functions give you access to general information about Campground Master, or things outside of Campground Master such as Windows functions and files.

 

 

 

(Back to Function Types List)

 

 

 

Function:AddAuditTrailEntry        
Result-type:Boolean        
Arguments:nType, rRecord, cMessage        
Description:Adds an Audit Trail entry.  Must specify a valid Audit Trail Entry Type numeric value (see Fixed List values).  Optionally specify the record referenced by the entry (else use NullRecord()), and message/details text of any length.  Always returns True.        

 

 

Function:AppendFile        
Result-type:Boolean        
Arguments:cFile, cText        
Description:Appends the contents of a text string to a file (after any existing contents). Note that newline characters in the text are written as carriage return-linefeed pairs. The file must already exist. The filename parameter can either have a complete path or just a filename -- if just a filename, it must be in the same folder as the current database.        

 

 

Function:BackupDatabase        
Result-type:Boolean        
Arguments:cFile [, fCompress]        
Description:Creates a backup of the database to the specified file (which should include the full path, file name and file extension). Compression is optional -- if fCompress is not specified then it will be compressed by default. Return indicates success of backup file creation.        

 

 

Function:BrowseOpenFile        
Result-type:Text        
Arguments:cPath, cFile, cExtension, cTypeMask, bMultiple        
Description:Opens a File-Open dialog to choose a file to open.  Can specify a starting path, default file name or mask (e.g. "*.txt"), file extension, and file type masks (any of these can be empty strings to use defaults).  Can also choose to allow multiple file selection.  File type masks is a list of description/mask pairs with '|' delimiter, with double '||' to end, e.g. "All Files (*.*)|*.*||".  Returns the full path and file name of the file selected.  If multiple files, the return string will be each file selected, separated by a '|' character.        

 

 

Function:BrowseSaveFile        
Result-type:Text        
Arguments:cPath, cFile, cExtension, cTypeMask        
Description:Opens a File-Save dialog to choose a file location and name.  Can specify a starting path, default file name or mask, file extension, and file type masks (any of these can be empty strings to use defaults).  File type masks is a list of description/mask pairs with '|' delimiter, with double '||' to end, e.g. "All Files (*.*)|*.*||".  Returns the full path and file name of the file selected.        

 

 

Function:CloseFile        
Result-type:Boolean        
Arguments:pFileHandle
Description:Closes the file opened with OpenFile.  Return is always True.        

 

 

Function:CreateDirectory        
Result-type:Boolean        
Arguments:cDirectory        
Description:Creates a new directory by the given name.  The directory parameter must have a complete path.  Returns True if successful (or if the directory already existed).        

 

 

Function:CurrentOpLevel        
Result-type:Numeric        
Arguments:(none)        
Description:Returns the access level operator currently logged in. 0 = None logged in, 1 = Guest, 2 = Clerk, 3 = Reservations, 4 = Manager, 5 = Administrator        

 

 

Function:CurrentOpName        
Result-type:Text        
Arguments:(none)        
Description:Returns the name of the operator currently logged in, if any        

 

 

Function:CurrentOpRec        
Result-type:Record        
Arguments:(none)        
Description:Returns the Operator record for the operator currently logged in, if any        

 

 

Function:CurrentShift        
Result-type:Numeric        
Arguments:(none)        
Description:Returns the current shift number for transactions (assuming Shift functionality is enabled).  Would be 0 if shifts never used.        

 

 

Function:DatabaseDefaultFileName        
Result-type:Text        
Arguments:(none)        
Description:Gets the name of the default database file, including the .prk extension.  This is the Auto-open database, as defined in Program Options / Database, which may not be the same as the currently open database.  Does not include the path (use DatabaseDefaultPath() and concatenate them to get the full file name & path).        

 

 

Function:DatabaseDefaultPath        
Result-type:Text        
Arguments:(none)        
Description:Gets the path of the default database (folder location).  This is the Auto-open database, as defined in Program Options / Database, which may not be the same as the currently open database.  Will always end with the '\' character.        

 

 

Function:DatabaseName        
Result-type:Text        
Arguments:(none)        
Description:Returns the name of the currently open database (the title only, no path or extension)        

 

 

Function:DatabasePath        
Result-type:Text        
Arguments:(none)        
Description:Returns the path of the currently open database (includes the ending backslash, e.g. 'C:\' or 'C:\MyData\')        

 

 

Function:DatabasePreferredPath        
Result-type:Text        
Arguments:(none)        
Description:Gets the path that the system prefers/recommends to use for the database (e.g. shared / public documents), where it also looks for the INI file.  Will always end with the '\' character.        

 

 

Function:DeleteDirectory        
Result-type:Boolean        
Arguments:cDirectory        
Description:Deletes a directory by the given name.  The directory parameter must have a complete path.  The directory must be empty, and must not be the current working directory or the root directory.  Returns True if successful (or if the directory was already non-existent).        

 

 

Function:DeleteFile        
Result-type:Boolean        
Arguments:cFile        
Description:Deletes the file by the given name. The filename parameter can either have a complete path or just a filename -- if just a filename, it must be in the same folder as the current database.  Returns True if the file existed before DeleteFile was called, False if it did not.        

 

 

Function:DirectoryExists        
Result-type:Boolean        
Arguments:cDirectory        
Description:Checks to see if a directory exists by the given name.  The directory parameter must have a complete path.        

 

 

Function:ExportToiCal
Result-type:Boolean        
Arguments:bUpload, bNoPrompts, bSilent        
Description:Generates the iCal files and optionally uploads them to a web site via FTP.  The settings in Maintenance / Online Reservations / Other Online interfaces / iCal will be used, as well as the iCal Profiles, and must be set up beforehand.  If uploading, the settings in Online Reservations - Connections & Options / iCal must also be set up.  The bNoPrompts flag may be set to prevent error prompts and bSilent may be set to hide the progress dialog, however the system will probably be unresponsive during this time.  The default parameters are all False (generate pages only, not silent, show errors).  The return value indicates whether it was successful.

 

 

Function:ExportVacancyToWeb        
Result-type:Boolean        
Arguments:bUpload, bNoPrompts, bSilent        
Description:Generates the web site vacancy grids and optionally uploads them to a web site via FTP. The settings in File / Export to Web Vacancy will be used, and must be set up beforehand. If uploading, the settings in Online Reservations - Connections & Options / Export to Web must also be set up. The bNoPrompts flag may be set to prevent error prompts and bSilent may be set to hide the progress dialog, however the system will probably be unresponsive during this time. The default parameters are all False (generate pages only, not silent, show errors). The return value indicates whether it was successful.        

 

 

Function:FileExists        
Result-type:Boolean        
Arguments:cFile        
Description:Checks to see if a file exists by the given name. The filename parameter can either have a complete path or just a filename -- if just a filename, it must be in the same folder as the current database.        

 

 

Function:FtpUploadFile        
Result-type:Boolean        
Arguments:cFile, cServer, cRemoteDir, cUser, cPassword, nPort, bPassive [, bShowProgress [, bShowPrompts [, bSSL [, bSSLImplicit [, bSSH]]]]]        
Description:Uploads a file to an FTP server.  Defaults are to show progress dialog (bShowProgress=.T.) and show any error prompts (bShowPrompts=.T.)  The return value indicates whether it was successful.        

 

 

Function:GetTempPath        
Result-type:Text        
Arguments:(none)        
Description:Gets the path of the 'Temp' folder as determined by Windows.  Will always end with the '\\' character.        

 

 

Function:MasterWorkstation        
Result-type:Numeric        
Arguments:(none)        
Description:Returns the Workstation ID for 'Master' computer        

 

 

Function:MaxWorkstations        
Result-type:Numeric        
Arguments:(none)        
Description:Returns the maximum number of workstations licensed for this installation        

 

 

Function:MessageBox        
Result-type:Numeric        
Arguments:cMessage [, nButtons [, nIcon]]        
Description:Shows a message in a prompt window. The nButtons parameter can be 0 for OK, 1 for OK & Cancel, 2 for Yes & No, or 3 for Yes, No, & Cancel. The nIcon parameter can be 0 for none, 1 for Warning/Exclamation, 2 for Error/Stop, or 3 for Information. Returns the button clicked : 0 = Cancel, 1 = OK, 2 = Yes, 3 = No.        

 

 

Function:OpenFile        
Result-type:Record (FileHandle)        
Arguments:cFile        
Description:Opens a file for use with ReadFileLine, e.g. for reading sequential lines of text.  The filename parameter can either have a complete path or just a filename -- if just a filename, it must be in the same folder as the current database.  The return value is the file handle, as a Record type (for use in ReadFileLine and CloseFile), or 0 if failure.  Be sure to use CloseFile when done reading the file.        

 

Function:QueueEmail        
Result-type:Boolean        
Arguments:cFromName, cFromAddress, cToName, cToAddress, cSubject, cBody [,cFile, bFixedPitch, cCC, cBCC, fSkipAutoBCC, fSkipAutoCC]        
Description:Queues up an E-mail message for batch sending, using the internal SMTP functionality.  The Online Setup for the SMTP settings must be configured and enabled.  If the From name & address are blank, it will use the defaults from the SMTP settings.  Optionally can include one or more file attachments (the full path must be specified for each -- use the '|' character between multiple file names).  The return value indicates whether it was queued successfully.  Use ResetEmailQueue() before sending, and SendQueuedEmails() to initiate the batch sending after all E-mails are queued.        

 

Function:ReadFile        
Result-type:Text        
Arguments:cFile        
Description:Reads the entire contents of a file into a text string. The filename parameter can either have a complete path or just a filename -- if just a filename, it must be in the same folder as the current database. The maximum file size is 1,000,000 bytes.        

 

 

Function:ReadFileLine        
Result-type:Boolean        
Arguments:pFileHandle, cVar        
Description:Reads one line of a file into a text string.  First parameter must be a handle returned from OpenFile().  The second parameter is the variable name into which the line will be placed (variable should be quoted, like \"cLine\").  The return value is True if successful, False if end of file or other failure.        

 

 

Function:RefreshDisplay        
Result-type:Boolean        
Arguments:(none)        
Description:Refreshes the main display (e.g. the current Tab View being displayed).  This may need to be used after changing reservation information so the changes are reflected on the Rack, for instance.  Always returns True.        

 

 

Function:ResetEmailQueue        
Result-type:Boolean        
Arguments:(none)        
Description:Resets the Batch E-mail queue.  For use with QueueEmail() and SendQueuedEmails() functions.  Return value is always True.        

 

 

Function:SaveDatabase        
Result-type:Boolean        
Arguments:(none)        
Description:Immediately saves the database (to the current database file.  Useful when making certain changes that don't normally trigger a save.  Return indicates whether saving was successful.        

 

 

Function:SendEmail        
Result-type:Boolean        
Arguments:bPreview, cFromName, cFromAddress, cToName, cToAddress, cSubject, cBody [,cFile, bFixedPitch, cCC, cBCC, fSkipAutoBCC, fSkipAutoCC]        
Description:Sends an E-mail message, using the internal SMTP functionality.  The Online Setup for the SMTP settings must be configured and enabled.  If the bPreview flag is set, the message will be shown in a window first, where it can be edited.  If the From name & address are blank, it will use the defaults from the SMTP settings.  Optionally can include one or more file attachments (the full path must be specified for each -- use the '|' character between multiple file names).  The return value indicates whether it was successful.
 
Function:SendEmailForRec        
Result-type:Boolean        
Arguments:rRecord, bPreview, cFromName, cFromAddress, cToName, cToAddress, cSubject, cBody [,cFile, bFixedPitch, cCC, cBCC, fSkipAutoBCC, fSkipAutoCC]        
Description:Sends an E-mail message, using the internal SMTP functionality.  This version includes the record you're sending it for, so it will appear in that record's Audit Trail. The Online Setup for the SMTP settings must be configured and enabled.  If the bPreview flag is set, the message will be shown in a window first, where it can be edited.  If the From name & address are blank, it will use the defaults from the SMTP settings.  Optionally can include one or more file attachments (the full path must be specified for each -- use the '|' character between multiple file names).  The return value indicates whether it was successful.

 

 

Function:SendMessageToWorkstation        
Result-type:Boolean        
Arguments:nWorkstationID, cText        
Description:Sends a text message to the designated workstation.  This is primarily for custom use -- by default, the message is simply displayed as a pop-up, however you can also intercept it to create custom functionality using an Event Action ("Network Text Message Received" -- the sending WS will be in ThisValue(), the message will be in ThisTextValue() ).

 

 

Function:SendQueuedEmails
Result-type:Boolean        
Arguments:(none)        
Description:Sends the Queued E-mails, using normal Batch E-mail settings for the number to send at a time and pausing between sub-batches.  Will remove all sent messages from the Queue.  If some are not sent (canceled or error), it will ask whether to leave them in the queue or not (call this function again to continue sending).  For use with the QueueEmail() function.  Return value indicates whether all were sent successfully.        

 

 

Function:SetVar        
Result-type:Boolean        
Arguments:cVarName, eExpression        
Description:Creates and/or sets a variable which can be used in subsequent expressions.  Will also work with pre-existing global variables (assuming no local variable by that name also exists), but if a variable does not exist then it will be created for the 'local' context only.  Variable names can contain 'A'-'Z', 'a'-'z', '0'-'9', or '_' characters.  Returns .T. is successful, .F. if variable cannot be created or set.        

 

 

Function:SetVarGlobal        
Result-type:Boolean        
Arguments:cVarName, eExpression        
Description:Creates and/or sets a global variable which will be available to any expressions until the program is shut down.  Variable names can contain 'A'-'Z', 'a'-'z', '0'-'9', or '_' characters.  Returns .T. is successful, .F. if variable cannot be created or set.        

 

 

Function:ShellExecute        
Result-type:Boolean        
Arguments:cOperation, cFile, cParams, cDir        
Description:Uses the system 'ShellExecute' function to open a document, execute a program, explore a folder or other functions. See Windows development specifications for details.        

 

 

Function:VarExists        
Result-type:Boolean        
Arguments:cVarName        
Description:Checks to see if a variable exists either in the current context or as a global variable (does not distinguish the type).        

 

 

Function:VarExistsGlobal        
Result-type:Boolean        
Arguments:cVarName        
Description:Checks to see if a global variable exists.        

 

 

Function:Workstation        
Result-type:Numeric        
Arguments:(none)        
Description:Returns the Workstation ID for this computer        

 

 

Function:WriteFile        
Result-type:Boolean        
Arguments:cFile, cText        
Description:Writes the contents of a text string to a file. Creates the file if necessary, and overwrites it if it already exists. Note that newline characters in the text are written as carriage return-linefeed pairs. The filename parameter can either have a complete path or just a filename -- if just a filename, it must be in the same folder as the current database.        

 

 

 

 

 

 


Page URL https://CampgroundMaster.com/help/generalsystem.html

Campground Master Home