About    Download    Order    Support


InnPlanner Reservation Software Videos

About
Download
Order/Prices
Support/Contact
Partner Program
Press Room
Online Help


Recent News

InnPlanner 2010 Released
New faster database engine, more customization features, weekly tariffs, full multi-user work support and much more...

2010 Feb 10

InnPlanner 2010 RC1
InnPlanner 2010 Release Candidate 1 is ready for downloading and testing. You can download it from the "Downloads" section.

2010 Jan 14


Hotel Software Documentation

About Variables

Variables (Advanced Scripting)

Introduction

This section outlines the guidelines for using variables in scripts.

Variables are used to store information that can further be used.

The values of variables can be set in scripts and user functions.

You can use variables almost everywhere: in math formulas, reports, queries, text formulas, custom export templates, etc.

In formulas the variable is usually shown in brackets and a $ sign is added before the variable name, for example: [$a], [$order_date], [$text]. You can use all characters except for [, ], $ and ^ in the variable name.

Variables Scopes

Starting from version 5.0 the program uses variable scopes. The variable scope defines the area where you can use the value of the variable.

All variables can be divided into local and global:

  • Local variables can be used only in scripts where they were created. For example, we placed a button on the form, and when we click this button, the [$title] variable is created in the script and a "Dear Mr/Ms" value is initialized. If we add the output of this variable to the Report Style Template and click "File->Print...", we'll get an error message saying that the variable wasn't found. However, if we add a print command to the script where the variable was initialized, its value will be printed out in the report.
  • If the variable is declared as global, it can be used in any part of the program. For example, if the [$title] variable was global in our example, we wouldn't get an error trying to print the text without adding the corresponding command to the script where the variable was declared.

Predefined and system variables are separate types of variables:

  • Predifined. A predefined variable is a local variable, but unlike local variables it's defined before the script is executed. For example, the arguments of User Functions or variables given to the script after parsing are predefined variables.
  • System variables are global variables that contain system values like current time, name of the database user, etc. Their values cannot be changed.

All variables are shown in the variable tree. To make a local variable global, right-click it and select the Make Global menu item:

Creating/Modifying Variables

To add a new variable to the script (or modify the existing value), click Add Variable in the Script Editor:

Enter the name of the variable in the dialog box. Select the checkbox on the right to make the variable global:

After that, select data the variable should be based on. Depending on the data type, the variable creation dialog box can look differently.

By type, all variables can be divided into:

  • Text/Math/Date - regular variables that store text, numbers, dates, etc.
  • RecordSet - variables that store record list for the further use or modification.

See Also:

Text/Math/Date Variables

Recordset Variables

Creating Variables Using Forms

Script Designer

Action Editor

List of actions




Today"s Poll

What software do use for your inn/b&b/hotel/etc?

Do not use
Inn Planner
Access, Excel
ASSD
Auberge
Digitalrez
Easy Inn Keeping
EnSuite HR
GuestMaster
iMagic HR
Smart FX
Other