PDA

View Full Version : Need to display a content of a variable


DericLanza
03-26-2008, 02:55 PM
How can i display a content of a variable?

i have a test (5 pages, 50 questions) any answer have assigned a variable, I need to display this information in other page. ¿How can I do that? :huh

longedge
03-26-2008, 03:28 PM
You would most probably want to display your variable in a label or paragraph object by using the the Label.SetText or Paragraph.SetText actions.

If you want to display a number of variables together then you would concatentate (join) them for example if you had your individual answers as str_answer1, str_answer2, str_answer3 etc. etc. then to put them together you would use -

str_all_answers = str_answer1.."\r\n"..str_answer2.."\r\n"..str_answer3
--and to display the concatenated string in a paragraph called Paragraph1
Paragraph.SetText("Paragraph1", str_all_answers);

the \r\n just adds a new line. You can do this anywhere in your project because variables are by default global, that is when you go from page to page they hold the same value until it is re-assigned.

ShadowUK
03-26-2008, 03:30 PM
How can i display a content of a variable?

i have a test (5 pages, 50 questions) any answer have assigned a variable, I need to display this information in other page. ¿How can I do that? :huh

You could always add the result to something like Page1Result on the On Close event, meaning everytime the user navigates to another page, it will globally set that meaning you can on page 6 or whatever the result page is, Concatentate all those together and put them together with something like.

Dialog.Message("Results from Pages 1-5", "Page 1: "..Page1Result.."\r\nPage 2: "..Page2Result.."\r\nPage 3: "..Page3Result.."\r\nPage 4: "..Page4Result.."\r\nPage 5: "..Page5Result);

DericLanza
03-27-2008, 01:53 PM
Thank you buddy, I already did and it works great.:yes