Im currently looking for "loading" a text file in a ListView Gadget , each line of the text on a ListView one.
My problem is that the
SendMessage_(GadgetID(#ListView_0), #LB_ADDSTRING, 0, String)
doesnt seem to work for me .. i bet i m wrong with the OpenFile command trying to retrieve each line then send it to ListView via SendMessage_ ...
could someone give me a hint to create a routine retrieving each line strings after a OpenFile command on a .txt file ?
Adding String in a ListView
-
- Enthusiast
- Posts: 229
- Joined: Wed May 14, 2003 3:38 pm
- Location: Lüneburg - Germany
Code: Select all
Procedure FillLVGWithTextFile(LVGadget.l, FileName$)
If IsGadget(LVGadget) <> 0
FileNr.l = ReadFile(#PB_Any, FileName$)
If FileNr <> 0
While Eof(FileNr) = 0
AddGadgetItem(LVGadget, -1, ReadString())
Wend
ProcedureReturn #True
EndIf
EndIf
ProcedureReturn #False
EndProcedure
-
- Enthusiast
- Posts: 229
- Joined: Wed May 14, 2003 3:38 pm
- Location: Lüneburg - Germany