To first use a variable, you'll need to declare it by telling QM what kind it is and what you want to call it. Here's what it looks like in the wild.
str aThat was easy enough but what can you DO with it? Well, let's start by giving it some values; which can be done several different ways.
str a="anything you want"
Note: the use of the double-quotes.
This gets the contents of the clipboard.
This gets the currently selected text.
This gets the tittle-bar text of the currently active window.Now let's put 'em into play. Let's say you want to create a macro that will grab the url of the current web page that you are on and send an email to your buddies (cuz they don't get enough of that stuff from their moms). In FireFox and I.E. 7, if you hit Alt-d the address bar is given the focus and the entire contents are selected. Let's put that into a string variable and the combine it with another string variable and then copy all that to the clipboard ready to paste into an email. Here's how we do it.
str url mesText
;Hey guys you gotta check this out.
Now there are some strange things going on in there so let's take a look.
First, line one is a shorthand way of creating more than one variable on one line. Second, the variable mesText is assigned a value rather oddly. If you set it up like this, every line that follows the 'mesText=' line that has a semi-colon or a space in the front (in other words, that are marked as 'comments' in the code) are assigned as the variable value. This allows you to set big blocks of text without it running all the way across the page and manually entering in the line-breaks (BTW: use  as the escape-characters for a line-break in QM). Moving on, we have the 'get selection' function (this gets the url). And then, we have the 'from' function. Now, this is a handy one. 'From' allows you to combine (concatenate) two or more string variables and or text 'chunks' that are surrounded by double-quotes. To say it in a human language you would say, "Tack on 'url' to the end of 'mesText'." And then it takes the new value of mesText and loads it to the clipboard. All you have to do is: open a new email; paste it into the body; add a subject; and address it.
Ummmm....yeah....that's too much freakin' work! So, let's turn up the juice and see what shakes loose (MAN, I love quoting old 80's flicks!).
str url mesText mailto subj ;;I'm creating a bunch of variables at one time
subj.findreplace(" - Mozilla Firefox" "");;I'm just pulling out the 'Mozilla Firefox' part cuz I don't need it
mailto.findreplace("subHere" subj);;I'm injecting the url into the subject parameter of the mailto command
;Hey guys you gotta check this out.%0D%0D
mailto.from(mailto mesText url);;I'm 'stringing' them all together here
Oh yeah, now that's lazy with a capital "L" baby efficient and helpful; besides, you've got better things to do than menial cut/paste you've got to defend the Frontier against Xur and the Ko-Dan Armada!
So have at it and I'll see you next time cause the hook always brings you back.