Append text into paragraph

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Fashion
    Forum Member
    • Sep 2003
    • 83

    Append text into paragraph

    Does anybody know how to append variable string into paragraph object ?

    Variable string as Line . . . one
    Variable string as Line . . . two
    Variable string as Line . . . three
    etc . . .

    How to put a kind of carriage return (enter) automaticaly
    after each line ?

    I must use paragraph for the transparent background.

    Thanks
  • Intrigued
    Indigo Rose Customer
    • Dec 2003
    • 6138

    #2
    strAVariableHere.."\r\n"
    Intrigued

    Comment

    • longedge
      Indigo Rose Customer
      • Aug 2003
      • 2498

      #3
      Just as a matter of interest.

      Label objects have transparent backgrounds and using concatenation is the way to produce a multi line label e.g.

      Code:
      str_content="Label line 1";
      for count = 2, 10 do
      	str_content=str_content.."\r\nLabel line "..count;
      	Label.SetText("Label1", str_content);
      end

      Comment

      • Fashion
        Forum Member
        • Sep 2003
        • 83

        #4
        Intrigued, it really help me to get an exemple please. I'm not sure
        what to do with your code.

        Thanks

        Comment

        • Fashion
          Forum Member
          • Sep 2003
          • 83

          #5
          This is the code i use:

          A button start this action:

          result = Dialog.FolderBrowse("Select folder:", "C:/");
          Paragraph.SetText("Paragraph", result);

          I need to click the same button again and append the next
          result to the paragraph object.

          Any help please ?

          Comment

          • longedge
            Indigo Rose Customer
            • Aug 2003
            • 2498

            #6
            Originally posted by Fashion
            This is the code i use:

            A button start this action:

            result = Dialog.FolderBrowse("Select folder:", "C:/");
            Paragraph.SetText("Paragraph", result);

            I need to click the same button again and append the next
            result to the paragraph object.

            Any help please ?
            The " .. " that Intrigued and I mentioned concatenate (tack on to the end of) a string or variable to another one so if you change your code something like -

            Code:
            result = Dialog.FolderBrowse("Select folder:", "C:/");
            content = content.."\r\n"..result
            Paragraph.SetText("Paragraph", content);
            this will make the string " content " longer and longer and each \r\n adds a new line. N.B. you have to set the initial value of content somewhere so if for instance you put -

            Code:
            content = Dialog.FolderBrowse("Select folder:", "C:/");
            in your preload then that would initialise the string.

            Comment

            • Fashion
              Forum Member
              • Sep 2003
              • 83

              #7
              Sorry Guys, i don't know why but it does'nt work . . .

              However, i finaly found this:

              result = Dialog.FolderBrowse("Select folder:", "C:\\");
              TextFile.WriteFromString("AutoPlay\\Docs\\Temp.txt ", result.."\r\n", true)
              result = TextFile.ReadToString("AutoPlay\\Docs\\Temp.txt");
              Paragraph.SetText("Paragraph", result);

              and it works great. A kind of paragraph update each time i choose and write
              a new folder to the list.

              "\r\n" seems to work with text file and not
              with paragraph !!

              Thanks

              Comment

              • longedge
                Indigo Rose Customer
                • Aug 2003
                • 2498

                #8
                The method works with both label and paragraph objects. The attached file has a label and paragraph side by side both of which display the concatenated string.

                Comment

                • Fashion
                  Forum Member
                  • Sep 2003
                  • 83

                  #9
                  Thank you guy, it works great !

                  Comment

                  Working...
                  X