Need to display a content of a variable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • DericLanza
    Forum Member
    • Mar 2008
    • 35

    Need to display a content of a variable

    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?
  • longedge
    Indigo Rose Customer
    • Aug 2003
    • 2498

    #2
    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 -

    Code:
    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.

    Comment

    • ShadowUK
      No longer a forum member
      • Oct 2007
      • 1322

      #3
      Originally posted by DericLanza View Post
      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?
      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.

      Code:
      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);

      Comment

      • DericLanza
        Forum Member
        • Mar 2008
        • 35

        #4
        Thanks

        Thank you buddy, I already did and it works great.:yes

        Comment

        Working...
        X