Code Syntax

<< Click to Display Table of Contents >>

Navigation:  Part 2: DeltaGUI Software > Building a Show by Combining Resources > Using Sequences > Global Sequence Variables >

Code Syntax

Comments

Can have full line comments like this or
$myvar = 2  // after the code comment

Comparison

valid tests  =  !=  and  or  <  >

if ($myvar = $myvar2)

if ($myvar = 2)

if (2 = $myvar)

if ($myvar > $myvar2)

if ($myvar and 2)

if ($myvar!=2)
and/or only work on Int type variables
greater than or less than work on int or float type variables

Addition, Subtraction, Multiplication, Division

$myvar = $myvar2 + $myvar3

$myvar = $myvar2 + 2

$myvar = 2 + $myvar2
The above lines can use + – * /

Create Global Variables

Global Variables can be int, float or string

globalvar $myintvar = 1

globalvar $myfloatvar = 6.54

globalvar $mystringvar = "movie"

globalvar $myintvar = 1  readonly
Adding readonly will create a variable with that value, which will not be written to the registry thereafter.
Creating a global var which already exists will do nothing.

Set Global Var

$myintvar = 12

$myfloatvar = 16.54

$mystringvar = "movie2"

$myvar = $myothervar

Special Variables

$myvar = $seqrandom[4,40]
Sets $myvar to a random value between 4 and 40

$myvar = $absoluteframe[2]
Sets $myvar to the current absolute frame of timeline 2

$mystringvar = $absoluteframe[1] smpte
Sets $mystringvar to the current absolute frame in smpte mode of timeline 1

$mystringvar = $absoluteframe[1] digits=5
Sets $mystringvar to the current absolute frame formatted to 5 digits where possible

$mystringvar = $currenttime
Sets $mystringvar to the current clock time of the server

$mystringvar = $currentdate
Sets $mystringvar to the current date in dd/mm/yyyy

$mystringvar = $currentdate usa
Sets $mystringvar to the current date in mm/dd/yyyy

$replacevarmode = [0/1]
0 is the default search replace mode, 1 is a simple string replace mode

Special Keywords

$persistsequence
Adding this keyword to your sequence will call this sequence to persist through filenew / open.

$startblock
All lines up to $endblock are completed in 1 frame

$endblock
All lines from start block up to $endblock are completed in 1 frame

Note : do not put Gotolabel loop inside start/end block as this will cause high CPU use.

Increment / Decrement

$myval++

$myval--

Conditional Branching

if (condition)
// Do something

else
// Do something else

Multiple if or if-else blocks are allowed, no nesting is allowed

Jump to lines

#start  // label is designated by #

$myintvar = 12

if ($myintvar>0)

$myintvar--

// do something 12 times

gotolabel #start

Note: the full list of sequence code supported is accessed from the Sequence Editor > Help button.