Le 6 mars 07 à 01:25 Matin, Sven E Olsson a écrit:
>
> On 2007-03-06, at 00:55, Lennox Jacob wrote:
>
>> Hello,
>>
>> I have this code which works well except that when there are less
>> than 8 lines of text (sometimes the number of lines vary in the
>> creation of the file) I would like to prevent the extra commas from
>> coming up and I would like to have the full stop at the end.
>>
>> Kindly assist.
>> Thanks.
>> Lennox.
>>
>> Dim f as folderitem = DocumentsFolder.child("My Temp1 File")
>>
>> Dim tis as TextInputStream = f.OpenAsTextFile
>> If tis is nil then
>> //check f.LastErrorCode
>> Return
>> End if
>>
>> EditField10.text = tis.ReadLine + ", " + tis.ReadLine + ", " +
>> tis.ReadLine + ", " + tis.ReadLine + ", " + tis.ReadLine + ", " +
>> tis.ReadLine + ", " + tis.ReadLine + ", " + tis.ReadLine + ". "
>>
>> tis = nil //the file is closed when the object is destroyed
>>
>>
>
> Just an another try ...
>
> dim f as folderitem DocumentsFolder.child("My tmp file")
> dim LinesStr as string
>
>
> if f <> nil and f.exists then
>
> Dim tis as TextInputStram = f.OpenAsTextFile
> if tis = nil then return
> While not tis.EOF
> LinesStr = LinesStr + tis.readLine + ","
> Wend
>
> tis = nil
>
> LineStr = left(LineStr, len(LineStr -1) + "."
>
> EditField1.Text = LineStr
>
> end if ' nil and exists
>
>
>
> Sven E
It's good, but you forget a token:
> dim f as folderitem DocumentsFolder.child("My tmp file")
should be
> dim f as folderitem = DocumentsFolder.child("My tmp file")
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>