[Gambas-user] read a file into a listview - but backwards

Doriano Blengino doriano.blengino at ...1909...
Fri May 1 08:37:22 CEST 2009


> Il giovedì 30 aprile 2009 19:46:25 Joshua Higgins ha scritto:
>   
>> Hi all,
>>
>> Is it possible to read a file and load it line by line into a listview, but
>> backwards? I have been using the example from gambasdoc for loading files
>> line by line, but I'm writing a logging page and want to show newest items
>> first.
>>     

    PUBLIC SUB Form_Open()
      DIM f AS File
      DIM s AS String
      DIM n AS Integer

      ListView1.Add(0, "")
     
      f = OPEN "FMain.class" FOR INPUT
      WHILE NOT Eof(f)
        LINE INPUT #f, s
        INC n
        ListView1.Add(n, s, NULL, 0)
      WEND
      CLOSE f
    END


Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."





More information about the User mailing list