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
Answer Cmd
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
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 exampleWhich 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.
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
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.
-
- Posts: 137
- Joined: Thu Jul 24, 2008 11:22 pm