• grandMA3 User Manual
    • About the manual
    • Device Overview
      • grandMA3 consoles
        • grandMA3 full-size
        • grandMA3 full-size CRV
        • grandMA3 light
        • grandMA3 light CRV
        • grandMA3 compact XT
        • grandMA3 compact
      • grandMA3 extension
      • grandMA3 replay unit
      • grandMA3 processing units
      • grandMA3 Nodes
      • grandMA3 Nodes DIN-Rail
      • grandMA3 I/O Node
      • grandMA3 I/O Node DIN-Rail
      • grandMA3 onPC command wing XT
      • grandMA3 onPC command wing
      • grandMA3 onPC fader wing
      • grandMA3 onPC rack-unit
      • Screen allocation
      • Keyboard shortcuts
      • Keys
        • . [Dot]
        • <<< [GoFastBackward] | Black
        • >>> [GoFastForward] | Flash
        • - [Minus]
        • + [Plus]
        • / [Slash] | * [Asterisk/Multiply]
        • At
        • Assign
        • Align
        • Blind
        • Clear
        • Channel
        • Copy
        • Ctrl
        • Cue
        • Down
        • Delete
        • Esc
        • Edit
        • Freeze
        • Full
        • Fixture
        • Group
        • Goto
        • Go+ [large]
        • Go- [large]
        • Go+ | Temp
        • Go- | Top
        • Help
        • Highlt [Highlight]
        • If
        • Learn | Rate1
        • List
        • MA
        • Menu
        • Move
        • Next
        • Numeric keys | arrows
        • Oops
        • On
        • Off
        • Pause [large]
        • Pause | Fix
        • Page+
        • Page-
        • Please
        • Power
        • Preset
        • Prvw [Preview]
        • Prev [Previous]
        • Select
        • SelFix [SelectFixture]
        • Sequ [Sequence]
        • Set
        • Solo
        • Stomp
        • Store
        • Thru
        • Time
        • Up
        • Update
        • U1
        • U2
        • X1 | Clone
        • X2 | Link
        • X3 | Grid
        • X4 | Layout
        • X5 | Step
        • X6 | TC
        • X7 | View
        • X8 | DMX
        • X9
        • X10
        • X11
        • X12
        • X13 | Phaser
        • X14 | Macro
        • X15 | Page
        • X16 | Exec
        • Xkeys
      • Control elements
        • Command area
        • Master area
        • Custom area
        • Dual encoders
        • Level wheel
        • Grand master
        • Executor elements
      • Connector pin assignment
      • UPS battery
    • System Overview
      • Standalone device
      • Locally networked devices
      • World server
      • Parameters
        • Calculate parameters
        • Expand the amount of parameters
    • First Steps
      • Unpack the device
      • Check scope of delivery
      • Position the device
      • Connect power
      • Connect desk light
      • Connect external screens
      • Connect USB devices
      • Connect DMX
      • Connect Audio In
      • Connect MIDI
      • Connect LTC
      • Connect Ethernet
      • Connect DC Remote In
      • Connect grandMA3 extension
      • Connect grandMA3 fader wing
      • Turn on the device the first time
    • grandMA3 onPC
      • System requirements grandMA3 onPC
      • Windows installation
      • Optimize Windows
      • macOS installation
      • Optimize macOS
      • onPC Terminal App
      • onPC settings
    • Show File Handling
    • Workspace
      • User interface
        • Configuration of displays
        • Desk lock
        • User-defined area
        • Command line
        • Control bar
        • View bar
        • Tables in general
        • Trackpad window
      • Gestures
      • Command area
      • Master controls
      • Playback controls
      • Displays in grandMA3 onPC
      • Encoder bar
        • Feature group control bar
        • Encoder toolbar
      • Calculator
      • Playback bar
      • Command wing bar
      • Colors
        • System
        • Markers
        • Color theme
    • Command Syntax and Keywords
      • General syntax rules
      • General keywords
        • ; [Semicolon]
        • / [Slash]
        • . [Dot]
        • .. [DotDot]
        • = [Equal]
        • <<< [GoFastBackward]
        • >>> [GoFastForward]
        • - [Minus]
        • * [Asterisk]
        • % [Percent]
        • + [Plus]
        • Absolute
        • Acceleration
        • Action
        • ActivationGroup
        • Agenda
        • Align
        • AlignTransition
        • Appearance
        • Assign
        • At
        • Attribute
        • AutoCreate
        • Black
        • Blind
        • Block
        • BPM
        • Call
        • Camera
        • Capture
        • ChangeDestination
        • Channel
        • ChannelSet
        • Chat
        • ChatJoin
        • ChatLeave
        • Cleanup
        • Clear
        • ClearActive
        • ClearAll
        • ClearSelection
        • Clone
        • CommandDelay
        • Collect
        • Collection
        • Color
        • ColorDef
        • ColorTheme
        • Configuration
        • Console
        • Cook
        • Copy
        • Cue
        • CueAbs
        • CueDelay
        • CueFade
        • CueInDelay
        • CueInFade
        • CueOutDelay
        • CueOutFade
        • CueRel
        • CueUpdate
        • CurrentEnvironment
        • CurrentUser
        • CurrentUserProfile
        • Cut
        • DataPool
        • Deceleration
        • Decimal8
        • Decimal16
        • Decimal24
        • Default
        • Delay
        • Delete
        • DeleteOtherVersions
        • DelGlobalVar
        • DelUserVar
        • Dismiss
        • Display
        • DMXLayer
        • DMXAddress
        • DMXReadout
        • DMXUniverse
        • DoubleSpeed
        • Down
        • DumpLog
        • Drive
        • Echo
        • Edit
        • EditSetting
        • Eject
        • Effect
        • EndIf
        • Environment
        • Exchange
        • Executor
        • Export
        • Extract
        • Extension
        • Fade
        • Fader
        • FaderMaster
        • FaderRate
        • FaderSpeed
        • FaderTemp
        • FaderTime
        • FaderX
        • FaderXA
        • FaderXB
        • FeatureGroup
        • Filter
        • Fix
        • FixtureClass
        • FixtureLayer
        • Fixture
        • FixtureType
        • Flip
        • Flash
        • Fog
        • Font
        • Freeze
        • Full
        • Gel
        • GetGlobalVar
        • GetUserVar
        • Go+
        • Go-
        • Goto
        • Grid
        • GridPos
        • Group
        • HalfSpeed
        • HardwareKey
        • Help
        • Helplua
        • Hex8
        • Hex16
        • Hex24
        • Highlight
        • Houselights
        • Hz
        • If
        • IfActive
        • IfOutput
        • IfProg
        • Image
        • Import
        • Index
        • Insert
        • Integrate
        • Interface
        • Invert
        • Invite
        • IP
        • JoinSession
        • Key
        • Keyboard
        • KeyboardShortcuts
        • Knockin
        • Knockout
        • Label
        • Language
        • Layout
        • LearnSpeed
        • LeaveSession
        • Library
        • List
        • ListOwner
        • ListRef
        • Load
        • Loaded
        • LoadShow
        • Lock
        • Login
        • Logout
        • Lowlight
        • Lua
        • LuaFile
        • Macro
        • MArker
        • Master
        • MAtricks
        • Measure
        • Media
        • MemInfo
        • Menu
        • Mesh
        • MessageCenter
        • Monitor
        • Move
        • Multipatch
        • MyRunningMacro
        • MyRunningPreset
        • MyRunningSequence
        • Natural
        • NDI
        • NewShow
        • NextY
        • NextZ
        • Next
        • Node
        • NonDim
        • Normal
        • Off
        • Offset
        • On
        • onPC
        • OSC
        • Oops
        • OutputLayer
        • Page
        • Part
        • Park
        • Paste
        • Patch
        • Pause
        • Percent
        • PercentFine
        • Phase
        • Physical
        • Plugin
        • Preset
        • PresetUpdate
        • Press
        • Preview
        • PreviousY
        • PreviousZ
        • Previous
        • Programmer
        • Property
        • PU
        • Pyro
        • Rate1
        • RDM
        • Readout
        • Reboot
        • Recast
        • Record
        • Relation
        • Relative
        • Release
        • ReloadPlugins
        • ReloadUI
        • Remote
        • RemoteHID
        • RemoteCommand
        • Remove
        • RenderQuality
        • Reset
        • Restart
        • Root
        • RTChannel
        • RunningMacro
        • RunningPreset
        • RunningSequence
        • RunningTimecode
        • SaveShow
        • ScreenConfig
        • ScreenContent
        • Scribble
        • Seconds
        • Select
        • Selection
        • SelFix
        • Sequence
        • SendMIDI
        • SendOSC
        • Set
        • SetGlobalVar
        • SetUserVar
        • Shuffle
        • Shutdown
        • SnapDelay
        • SoftwareImport
        • SoftwareUpdate
        • SoundChannel
        • Solo
        • SpecialExecutor
        • Speed
        • Speed1
        • Stage
        • Station
        • Step
        • Stomp
        • SwitchGma2Mode
        • Swop
        • Store
        • Temp
        • Texture
        • Thru
        • Time
        • Timecode
        • TimecodeSlot
        • Toggle
        • TopUp
        • Top
        • Transition
        • Type
        • UIChannel
        • UIGridSelection
        • UnBlock
        • Universal
        • UnLock
        • UnPark
        • UnPress
        • Up
        • Update
        • UpdateContent
        • User1
        • User2
        • User
        • UserProfile
        • Video
        • Version
        • View
        • ViewButton
        • Width
        • World
        • Xkeys
        • Zero
      • Option keywords
        • /Active
        • /ActiveForSelected
        • /AddNewContent
        • /All
        • /AllForSelected
        • /Ask
        • /Auto
        • /CopyCueDst
        • /CopyCueScr
        • /CreateReferenceObject
        • /CreateSecondCue
        • /CueOnly
        • /Date
        • /Default
        • /DiscardChanges
        • /DMX
        • /Embed
        • /Enumerate
        • /File
        • /ForceGlobal
        • /GDTF
        • /Gaps
        • /Global
        • /GridMergeMode
        • /Indirect
        • /KeepActivation
        • /Look
        • /Merge
        • /NoConfirm
        • /OriginalContentOnly
        • /Overwrite
        • /Path
        • /Release
        • /Remove
        • /Screen
        • /Selective
        • /Universal
      • Extended command line syntax options
    • Windows, Views, and Menus
      • Add window
      • Rearrange
      • Store and recall views
      • Remove windows from a screen
      • Window settings
      • Menus
      • Change menu locations
      • Pool windows
        • Create pool object
        • Label pool objects
        • Move pool objects
        • Insert pool objects
        • Copy pool objects
        • Lock and unlock pool objects
        • Delete pool objects
    • Networking
      • Interfaces and IP
      • Session
        • Create a session
        • Join a session
        • Leave a session
        • Invite to a session
        • Dismiss from session
        • Create a custom key
        • Session master selection
      • Web remote
    • DMX In and Out
      • DMX port configuration
      • Ethernet DMX
        • Art-Net menu
        • sACN menu
        • Transmit DMX using Art-Net
    • Single User and Multi User Systems
      • Create User
      • User settings
    • Patch and Fixture Setup
      • What are fixtures
      • Add fixtures to the show
      • Add multipatch fixtures
      • MVR
      • Live patch
      • DMX sheet
      • DMX universes
      • Remove fixtures from the show
      • Position fixtures in the 3D space
      • 3D
      • Camera Pool
      • Stages
      • Classes and Layers
      • Attribute definitions
        • Activation group
        • Feature group
        • Deactivation group
      • Parameter list
      • DMX curves
    • Operate Fixtures
      • Select Fixtures
      • What is the programmer
      • Fixture sheet
      • Encoder resolution
      • Using the color picker
      • Gel pool
      • Selection bar
      • Align
      • Selection Grid
      • Smart view
      • General parent.child structure
    • Scribbles
      • Create scribbles
      • Edit scribbles
      • Assign scribbles
      • Delete scribbles
    • Images
      • Screenshots
    • Video
    • Appearances
      • Create appearances
      • Use appearances
      • Delete appearances
    • Groups
      • Create groups
      • Edit groups
      • Delete groups
      • Group masters
    • Presets
      • Preset pools
      • Create new presets
      • Recipe presets
      • Use preset
      • Edit or Update presets
    • Worlds and Filters
      • At filter
      • Create a world
      • Create a filter
      • Use a world or filter
      • Delete a world
      • Delete a filter
    • MAtricks and Shuffle
      • Blocks
      • Groups
      • Wings
      • Widths
      • Shuffle
      • Transform
    • Cues and Sequences
      • What is tracking
      • Sequences sheet
      • Content sheet
      • Sequence settings
      • Store cues
      • Update cues
      • Copy cues
      • Cue recipes
      • Store settings and preferences
      • Play back cues
      • Move in black
      • Cue timing
      • Renumber cues
      • Delete cues
    • Executors
      • Assign object to an executor
      • Executor configurations
      • Running playbacks
      • Special executors
    • Masters
      • Selected masters
      • Grand masters
        • Time Control
      • Speed masters
      • Playback masters
    • Recipes
    • Phasers
      • Phaser editor
      • Create sinus dimmer phaser
      • Create circle phaser
      • Create circle phaser around position
      • Create color rainbow phaser
    • XYZ
      • Activating XYZ for fixture types
      • MArker fixture
    • Macros
      • Create macros
      • Edit macros
      • Assign macros to keys and buttons
      • Variables
      • Examples
    • Agenda
      • View modes
      • Create an agenda entry
      • Edit an agenda entry
      • Agenda toolbar
    • Timecode
      • What are timecode slots
      • Timecode settings
      • Track groups
      • Time ranges and events
      • Toggle view mode
      • Record a timecode show
      • Record an external timecode show
      • Edit a timecode show
    • Layouts
      • Create a layout
      • Assign multipatch fixtures
      • Edit layout
      • Layout view settings
      • Edit layout view
      • Edit layout elements
      • Layout encoder bar
    • Plugins
      • What is Lua?
      • Handle
      • Functions - Object-Free API
        • BuildDetails
        • CloseUndo
        • Cmd
        • CmdIndirect
        • CmdIndirectWait
        • CmdObj
        • Confirm
        • CreateUndo
        • DataPool
        • DefaultDisplayPositions
        • DeskLocked
        • Echo
        • ErrEcho
        • ErrPrintf
        • Export
        • ExportCSV
        • ExportJson
        • FromAddr
        • GetPath
        • GetShowFileStatus
        • GetSubfixture
        • GetSubfixtureCount
        • HandleToStr
        • HandleToInt
        • HookObjectChange
        • HostOS
        • HostSubType
        • HostType
        • Import
        • IntToHandle
        • MasterPool
        • MessageBox
        • ObjectList
        • Patch
        • PopupInput
        • Printf
        • ProgrammerPart
        • ProgressBar
        • Pult
        • Root
        • SelectedSequence
        • Selection
        • SelectionCount
        • SelectionFirst
        • SelectionNext
        • SerialNumber
        • ShowData
        • StrToHandle
        • ShowSettings
        • TextInput
        • Timer
        • UserVariables
        • Version
      • Functions - Object API
        • Addr
        • AddrNative
        • Children
        • Dump
        • Export
        • HasActivePlayback
        • Import
        • ToAddr
    • Data Pools
    • System
      • Date and time
      • Clock
      • Desk lights
      • System information
      • System monitor
      • Info Window
    • Sound
      • Sound Window
    • Remote In and Out
      • DC remotes
      • MIDI remotes
      • DMX remotes
      • OSC
      • PSN
      • MIDI
    • RDM
    • Control other MA Devices
      • grandMA3 Nodes
      • MA Network Switch
      • RemoteHID
    • Update the Software
      • Update grandMA3 consoles
      • Update grandMA3 Nodes
      • Update grandMA3 onPC windows hardware
      • Update grandMA3 viz-key
      • Network update
      • Delete update files
      • Troubleshooting
    • Fixture Types
      • Import fixture types
        • Import GDTF
        • Conflicts in fixture types
      • Build fixture types
        • Insert fixture types
        • Insert DMXModes
        • Insert geometries
        • Insert models
        • Link models to geometries
        • Link DMX modes to geometries
      • Export fixture types
        • Export GDTF
    • File Management
      • SFTP connection
      • Import / Export Menu
      • Folder Structure
    • Shut down the System
    • Troubleshooting
      • Clean start
  • grandMA3 Quick Start Guide
  • grandMA3 Quick Manual consoles
  • grandMA3 Quick Manual processing units
  • grandMA3 Quick Manual Nodes
  • grandMA3 Quick Manual Nodes DIN-Rail
  • grandMA3 Quick Manual onPC command wing XT
  • grandMA3 Quick Manual onPC command wing
  • grandMA3 Quick Manual onPC fader wing
  • grandMA3 Quick Manual onPC rack-unit
  • grandMA3 Quick Manual viz-key
  • grandMA3 Quick Manual I/O Nodes
  • Release Notes
Select different version
 
Hint:
New help version
The help version you selected belongs to an older software version. You may want to view the latest help version.
Version 1.8

Variables

It is possible to create variables that can be used in macros or command line entries.

Variables are containers that can contain different kinds of content. The variable has a user-defined name that is written instead of the variable content. When the command is executed, then the variable name is replaced with the variable content.

A variable can contain three different types of data:

  • Integer: A signed whole number.
  • Double: A signed fixed-point number with six decimals.
  • Text: Any text string.

Signed numbers mean that they can be negative numbers, for instance, -7.

Variables are not strong-typed but typeless. This means that an existing variable can be changed to contain a different type.

The name of a variable can be composed of any character. Variable names are case-sensitive.

Hint:
It is not a requirement, but avoiding spaces in variables is a good idea. Consider using camelCase or PascalCase for variable names.

There are two different variable scopes. A scope defines who and where a variable can be used.

Variables can be scoped for the user, or they can be global variables.

User variables can only be seen and used by the user profile that creates them. Global variables can be seen and used by all users in the session.


SetGlobalVar and SetUserVar

Creating a variable is the same whether it is a user or global variable, but we use two different keywords to set one or the other: SetGlobalVar or SetUserVar.

This is the syntax:

SetGlobalVar ["Variable_Name"] ["Content text with or without spaces"]

SetGlobalVar ["Variable_Name"] [Integer or Double]

SetUserVar ["Variable_Name"] ["Content text with or without spaces"]

SetUserVar ["Variable_Name"] [Integer or Double]

The quotation marks are very important if the variable name contains spaces. If the name does not contain spaces, then they can be omitted.

The same is true for text strings as the variable content. Variable content must be put in quotation marks to ensure the software stores a text string.

Example

User name[Fixture]> SetUserVar MyFavoriteNumber 9
User name[Fixture]> SetUserVar MyFavoriteText "9"

These two commands create two different variables that might seem to have the same content, but the first one is a number and the second one is a text. It is not because of the names but the quotation marks in the second example.

Single and Double Quotation marks

It might be needed to store a variable with a text string that includes something in quotation marks. This presents an issue with how the software interprets the input and how it is interpreted when the variable is called during runtime.

The variable system supports single and double quote pairs.

This means that text strings can contain quoted text as long as the other quotation marks are used. 

Example

There is a need to work with a specifically named group ("Spots Grid") in different contexts. A variable with "Group" and the name can be stored as a variable:

User name[Fixture]> SetUserVar MySpecialGroup "Group 'Spots Grid' "

Notice the single quotes around the group name and the double quotes around the variable text string. These two pairs can be reversed for the same result.

Now the variable can be used to address the group:

User  name[Fixture]> $MySpecialGroup At 80

Notice that there is a $ sign before the variable name when using it. This instructs the software that this is a variable.

The response from the software is:

OK: Group "Spots Grid" At 80

The dollar sign and the variable name are replaced with the content of the variable.

GetGlobalVar and GetUserVar

The variables' content and type can be listed using the GetGlobalVar or GetUserVar keywords.

These keywords need to know what variable to show. The syntax is:

GetGlobalVar ["Variable_Name"]

GetUserVar ["Variable_Name"]

These commands show information about the variable name, content type, and content in the Command Line Feedback window.

They only show the variables in their scope. This means that the global version only shows global variables and the user version only shows the user variables.

This assumes that the variable names are known.

The asterisk (*) wildcard can be used to show all variables or a filtered list where a part of the name is known.

Examples

The current content of the variable called "MySpecialGroup" can be shown using this command:

User Name[Fixture]> GetUserVar MySpecialGroup

The feedback in the command line window could look like this:

                  MySpecialGroup  Text  "Group 'Spots Grid' "
OK: GetUserVar "MySpecialGroup"

 

The following example shows a list of all the global variables where the name contains the word "Our":

User Name[Fixture]> GetUserVar *ur*

The "O" is replaced with the asterisk to make sure the variables beginning with "Our" is also shown. The asterisk wildcard at the beginning says that there needs to be something before the letters we specify. In reality, the example will also show variables beginning with "Hour" or, in fact, anything with "ur" somewhere in the name. To specify variables beginning with "Our", then use the following example:

User Name[Fixture]> GetUserVar Our*

 

This example shows all the user variables:

User Name[Fixture]> GetUserVar *

Using Variables

Variables are used where the content of the variable is needed. A $ (dollar) sign is placed in front of the variable name to instruct the software that the following is a variable name and that it should replace the sign and variable name with the content of the variable.

If this result in a command that is not valid, then an error message is shown in the command line feedback window.

A variable was used in a previous example. It looked like this:

User  name[Fixture]> $MySpecialGroup At 80

The result is that the variable's text string content ("Group 'Spots Grid' ") is replacing the $MySpecialGroup. This works since the variable contains a text string with commands.

Using quotation marks when using variables is essential and makes a difference.

If the variable is used with quotation marks, like this:

User  name[Fixture]> $"MySpecialGroup" At 80

Then it fails because the content of the variable is called specifically as a string and the resulting feedback is:

Illegal object: Fixture "Group 'Spots Grid' " At 80

The software tries to use the variable content as a text string and does not interpret it as a command.

This might be useful in other cases. The variable name must be in quotation marks when the variable contains a text string that should be used as text. See the example below.

Example

This example uses a variable that contains a name of a group:

User name[Fixture]> SetUserVar MyGroupName "Spots Grid"

Now this variable can be used where the text otherwise would be used:

User name[Fixture]> Group $"MyGroupName" At 80

This command works. If the quotation marks are omitted, then it would fail:

User name[Fixture]> Group $MyGroupName At 80
Illegal object: Group "Spots" Grid At 80

The text string is interpreted as a command.

DelGlobalVar and DelUserVar

Variables can be deleted using the DelGlobalVar and DelUserVar keywords.

This is the syntax:

DelGlobalVar ["Variable_Name"]

DelUserVar ["Variable_Name"]

Deleting a variable cannot be oopsed.

There is not much else to say about deleting variables. When deleted, they do not exist anymore.

The name is needed to delete a specific variable, but the asterisk (*) wildcard can be used to delete a selection of variables.

Concatenate Variables

Variables can be concatenated by storing them into a new variable.

The desired result of the concatenation is to create a compound text string containing the concatenated variables. The output is always a text string. See below for the mathematical addition of number variables.

This is the syntax:

SetGlobalVar [MyConcatResult] $[VariableName]$[VariableName]

SetUserVar [MyConcatResult] $[VariableName]$[VariableName]

It is very important that there is no space between the variables that need to be concatenated or between any extra text that needs to be part of the concatenation.

Text can be added to the variable by adding it in quotation marks with no space between the end and start of quotation marks. There can be spaces inside the quotation marks. Se the example below.

Example

These examples use three variables:

Variable Name: Content Type: Content:
MyInteger Integer 9
MyKeyword Text Group
MyGroupName Text Perfect Macro

The goal is to concatenate these into a command string that can be used to store a group.

It can be done with one command, but here it is split up to look at different functions.

First, the keyword is combined with the integer into a new variable:

User name[Fixture]> SetUserVar MyCommandString $"MyKeyword"" "$"MyInteger"

There are a lot of quotation marks in this command. Setting the variable names in quotation marks ensures that the variable content is interpreted as text. This also means that the integer variable is converted to a text string.

Furthermore, there is a " " between the two variables to add a space between them.

The result can be seen with this command:

User name[Fixture]> GetUserVar MyCommandString

Next is adding the macro name to the string:

User name[Fixture]> SetUserVar MyCommandString $"MyCommandString"" '"$"MyGroupName""' "

Again it can be hard to see what is happening. The two variable names are in quotation marks. Between the two are a space and a single quotation mark in double quotation marks. After the last variable name, there is another single quotation mark inside double quotation marks.

The command looks like this without the double quotations:  SetUserVar MyCommandString $MyCommandString '$MyGroupName'

The existing content of MyCommandString is added to MyCommandString, plus the content of MyGroupName in single quotations.

The result is that MyCommandString is Group 9 'Perfect Macro' as a text string.

Now some fixtures can be selected, and this command can be executed:

User name[Fixture]> Store $MyCommandString

And then, a group is stored at group 9 with the name. Quotation marks must not be used in the command above.

Variable Addition

Concatenating variables with integer and/or double types does a mathematical addition instead of an actual concatenation. Here there is no use of quotation marks.

The result needs to be stored in a variable.

Example

This example uses three variables:

Variable Name: Content Type: Content:
MyInteger Integer 9
MySignedInteger Integer -2
MyDouble Double 6.500000

The first two variables can be added to each other with this command:

User name[Fixture]> SetUserVar MyResult $MyInteger$MySignedInteger

The result can be seen by looking at the command line feedback. It shows that the variable is stored with a value of 7.

The double can be added with an integer. The result will be a double to avoid data loss.

User name[Fixture]> SetUserVar MyResult $MyInteger$MyDouble

This stores the value of 15.500000 in MyResult.

Type Conversion

Type conversion has been happening in the examples above.

When used, an integer or double can be converted to text by putting the variable name in quotation marks. They will be converted when the command is executed.

Variables containing text that can be converted to an integer can be converted by setting the variable without quotation marks.

An integer can be converted to a double by adding it to a double with the value of 0.000000.

A double cannot be converted to an integer.

Examples

These examples use the following variables:

Variable Name: Content Type: Content:
MyInteger Integer 9
MyEmptyDouble Double 0.000000
MyText Text Hello

This example converts the integer to text:

User name[Fixture]> SetUserVar MyInteger $"MyInteger"

Converting this back to an integer can be done with the following command:

User name[Fixture]> SetUserVar MyInteger $MyInteger

Converting an integer to a double can be done using this command:

User name[Fixture]> SetUserVar MyResultr $MyInteger$MyEmptyDouble

 


Select different version