webDOMinator - Minion Scripting Language Reference

Search a Command:
<< Back to Variable Setting Commands

var

Usage...
var:variable-name = expression
Sets the variable specified variable-name to expression. Expression can be any concatenated string, literal text, or Mathematical expression, and can include other variables, DOM elements, or webDOM settings.
This applies to webDOM version 2.0.0 and above.

User Comments on var

using a variable within a command/reference

Written by: driven 3 years and 3 months ago

In order to use a variable within a command or dom string you should follow this format:

Code

var:x=next
click:dom.a.[var:x]


This would be same as:
Code

click:dom.a.next

Examples

Written by: webDOMinator 3 years and 5 months ago

Creating a variable with text in it.

Code
var:myvar=hello

Creating a variable with a numeric value in it.
Code
var:myvar=1

Creating a variable that's set to another variable plus a set number.
Code
var:firstvar=20
var:secondvar=var.firstvar-12
echo:var.secondvar

Creating a variable that concatenates text from other variables...
Code
var:firstvar=dog
var:secondvar=cat
var:thirdvar=house
var:sentence=The ^var.firstvar^ is always chasing the ^var.secondvar^ around the ^var.thirdvar
echo:var.sentence

Using Browser DOM referencing in variables to set variables to certain properties...
Code

var:realname=dom.div.fullname.innerhtml
var:phone=dom.span.phone.innerhtml
echo:Call ^var.realname^ at ^var.phone

More examples later...

Post a Comment About the "var" Command
Title:
Comment:
Post as Anonymous:
User Login
Username:
Email:
Password:
webDOMinator is copyright ©2008, 2009, 2010, 2011, 2012 Nathaniel D. Gibson. All Rights Reserved.
Contact | Tutorials | Forum
By using webDOMinator you are taking all liability in to your own hands. Nathaniel D. Gibson is not responsible for any damages, loss, or defamation (legal or otherwise) caused to you or your business from using this program. Nathaniel D. Gibson is not associated with, affiliated with, nor responsible for the content submitted and displayed by users of this site.