Code Syntax

<< Click to Display Table of Contents >>

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

Code Syntax

Comment

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

Compare

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

Add, Subtract, Multiply, Divide

$myvar = $myvar2 + $myvar3

$myvar = $myvar2 + 2

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

Concatenate arguments and strings

Addition with string variables concatenates them. Adding an int or a float to a string will concatenate the int or float as a string.

mediainsert resourcename = $thisClip + $thisVersion

mediainsert resourcename = $thisClip + $thisVersion + "_444"

mediainsert resourcename = $thisClip + $thisVersion + '_444'

load "C:\\Shows\\" + $showName

Use to concatenate the values of variables as strings, and explicit strings, within the argument of a function. Explicit strings can be enclosed by single or double quotes.

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 variable which already exists will do nothing.

Set a Global Variable

$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.

Page edited [d/m/y]: 26/02/2021