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.
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: | CloseFile |
Result-type: | Boolean |
Arguments: | pFileHandle |
Description: | Closes the file opened with OpenFile. Return is always True. |
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: | 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: | 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: | 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: | 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] |
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] |
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: | 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. Resets the Batch E-mail queue after sending, whether it's successful or not. For use with the QueueEmail() function. Return value indicates whether all were sent successfully. There is no information about which ones were sent successfully, if any, if there is an error. |
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. |