The Chain command is similar to the Jump command except that Lightwing branches to a page in another script, instead of a page within the current script. Also, only a single branch target can be defined, instead of a list of pages. The Chain command requires a script name (which may also include a path) followed by an optional page name. If the page name is omitted, the first page in the script will be the branch target. The referenced scripts should be in a scripts folder which can be the current scripts folder or a different folder specified by either an absolute or relative file path. Most of the same command options available for the Jump command can also be used with the Chain command, except for the count and index options.
Examples of Absolute and Relative Script File Paths
Script File Paths Path Types scripts/Default.lws Current Folder /home/root/lightwing/scripts/Default.lws Absolute demos/lightwing/scripts/Default.lws Relative
The Jump, Call, Chain and Link commands feature options to make branching conditional. Lightwing branches only if all of the defined conditions are true, otherwise execution continues with the next consecutive page in the current script.
Day Option
Defines a specific day and/or time condition on which a branch will be taken. This can be a time which reoccurs every day, or a day that reoccurs every week, or a month that reoccurs every year, or a specific calendar date and/or time event that only occurs once. The maximum number of conditions is 8 per page.
Time Condition Examples
Examples Occurrences 12:00PM Every day at Noon. Monday Every Monday at Midnight. Tuesday 12:00PM Every Tuesday at Noon. Wednesday January 12:00PM Every Wednesday in January at Noon. 1/1/2015 First day of 2015 at Midnight.
Example of a Page that Chains only on Mondays page: FirstPage chain: MondayPage day: Monday
Before Option
Defines a specific day and/or time condition before which a branch will be taken. This can be a time which reoccurs every day, or a day that reoccurs every week, or a month that reoccurs every year, or a specific calendar date and/or time event that only occurs once. The date and time syntax is the same as shown for the day option above.
After Option
Defines a specific day and/or time condition after which a branch will be taken. This can be a time which reoccurs every day, or a day that reoccurs every week, or a month that reoccurs every year, or a specific calendar date and/or time event that only occurs once. The date and time syntax is the same as shown for the day option above.
Portrait Option
Defines a display orientation condition that must be met for the branch to be taken. This parameter must be either on or off. The default is off, which means the display must have a landscape orientation for the branch to be taken. Otherwise, on means the display must have a portrait orientation for the branch to be taken.