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

Cycles

Cycles

Introduction

Cycles (loops) allow performing the same actions (cycle body) over different objects or under different conditions. For example, you can calculate the total of numbers 1 through 100, perform operations over several records stored in the recordset variable at once or print individual lines from a text.

A cycle always begins with the For... string. To identify the end of a cycle body, type Next Item:

Lines between the line For (2) and Next (4) make the cycle body. In this example, the cycle body contains only one line (3).

This program uses cycles of three types, which differ by the cycle subject:

For Interval (1,2,3...)

This cycle type changes the value of the specified variable in a specified range with a specified step and performs enclosed commands. Example:

In this example, the variable [$i] changes its value from 2 to 20 with step 2. For each of those values, the program will perform the commands contained in line (3), and user will see 10 messages with the following text:

  • Variable Value: 2
  • Variable Value: 4
  • Variable Value: 6
  • Variable Value: 8
  • ...
  • Variable Value: 20

For each line from text

This cycle type splits text to lines, and performs the enclosed actions over each line. Example:

In this example:

  • Line 1: Write the list of three cities in the variable [$cities].
  • Lines 2, 5: Define the cycle, in which the variable [$line] will consecutively contain a value from the list. In our case, that's the list of cities contained in the variable [$cities].
  • Lines 3, 4: Cycle body. Line 3 creates a new record, and line 4 writes the city name to the record's Title field.

This, upon the completion of this script we will have 3 records with titles respectively London, Paris, and Moscow.

Any data source can be used with this cycle - data from file (see Read File), field values from DB records, etc.

For Each record from recordset

This cycle type allows performing operations over a set of records in a database. The records are defined in the recordset variable, which can be created with a query, relational field, etc. Know more about recordsets...

In this example:

  • Line 1: Places the set of records created by the "All Records" query to the [$rset] variable.
  • Lines 2, 4: Define the cycle, in which all operations will apply to records stored in the [$rset] variable instead of current record.
  • Line 3: Cycle body. Increments the value of [Field A] by one.

See Also:

Scripts Basics

Script Designer

Using Variables

User Functions

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