On Mar 05, 2007, at 5:40 PM, Lennox Jacob wrote:

> Thankks Norman,
> Works great.
>
> I used
> Dim S as string
> S =  join(lines, ", ")
> EditField10.text = s + "."
> and I got the full stop at the end
>
> One part of the code I didn't understand though ...
>
>    dim lines(-1) as string
> I see it comes in here
>         lines.append line
> But how does that work?

Dim f as folderitem = DocumentsFolder.child("My Temp1 File")

    Dim tis as TextInputStream = f.OpenAsTextFile
    dim i as integer
    dim line as string
    dim lines(-1) as string

    If tis is nil then
      //check f.LastErrorCode
      Return
    End if

    for i = 1 to 8
      line = tis.readline // read ONE line from the text file
      if line <> "" then // if the line is NOT blank then we'll hang  
on to it in the array of lines we've read
         lines.append line
      end if
    next

    EditField10.text = join(lines, ", ") // this joins all the lines  
in the array togeterh and puts a , between each of them

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to