Announcement

Collapse
No announcement yet.

TextFile - trying to write out listbox contents and getting <CR> after each line?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • TextFile - trying to write out listbox contents and getting <CR> after each line?

    Each time an item is added to the listbox it gets recorded in a file. The problem is each line written is not one long string but a number of lines which include carriage returns. Is there any way round this or do I just stripe them off each time I read the file back.

    Read File, push contents i.e. Txt:ata;;Txt2:ata2 into listbox. Update record and write back.

    This gives me <CR><LF> for each listbox item.

    Cheers Russ

  • #2
    Re: TextFile - trying to write out listbox contents and getting &lt;CR&gt; after each line?

    Instead of adding each item to a text file as its added to the listbox.

    Add the item to the listbox, then do a
    %ItemText% = ListBoxObject[ListBox1].GetItemText (All)

    Then write the contents of %ItemText% out to the file overwriting the existing text file.

    You should then have the contents of listbox in the text file delimited with a ;; or whatever you choose.

    Comment


    • #3
      Re: TextFile - trying to write out listbox contents and getting &lt;CR&gt; after each line?

      I think I've sussed it.

      It was because I was trying to read the Itemdata from a multiple select and getting an error idex malformed.

      You can read ItemText from a multiple select but not Itemdata.

      What I've had to do is a while loop, decrementing the item count variable, and read the Itemdata in one at a time using gettemdata.

      Is there a better way?

      Comment

      Working...
      X