Page 1 of 1
Answer Cmd
Posted: Wed Mar 11, 2009 9:38 pm
by Glenn Boyce
I would like to display information contained in a number of variables in a dialogue box. I thought I'd use the "Answer' one and can incorporate one variable but can't seem to get it to work with more.
String I want is:
(variables are in brackets)
(tQty) "has been allocated against" (tItemNo) "on" (tDate)
any assistance welcome
cheers
Glenn
Posted: Wed Mar 11, 2009 9:49 pm
by SparkOut
Use "&" to concatenate the elements you want to display. Use "&&" to concatenate with a space between the elements. So you can put
answer tQty && "has been allocated against" && tItemNo && "on" && tDate
and that should do the trick.
The brackets will force Rev to evaluate the variables before inclusion, but it sort of does that automagically under most circumstances so you shouldn't need to include them. You might want the brackets if you were constructing a lookup by concatenating a name with a numeral index, for example
Code: Select all
repeat with i = 1 to 9
put i into field ("Field" & i)
end repeat
Which would put 1 into field "Field1" and 2 into field "Field2" etc etc. (Bad practice in some ways, but gives you the idea).
If you need to include quotes then you will need to do some extra, eg
answer "Field "Qty" has been completed" will fail because the opening quotes by "Qty" will be read as the closing quotes for the answer command.
So you would use the quote constant and concatenate as:
answer "Field" && quote & "Qty" & quote && "has been completed"
HTH.
Posted: Wed Mar 11, 2009 11:36 pm
by Glenn Boyce
Thanks. I must have done something wrong because I thought I had the syntax the same as you but it didn't work. Does now, thats the main thing!!