The CR/LF's are definately the problem.
I was putting in:
SendMessage_(GadgetID(0), #EM_SETTARGETDEVICE, #NULL, 0)
To set wordwrap on in the EditorGadget because without it, it is useless to read long text. I created two records and only the second would be read back in and displayed. There is an extra char being inserted or interpreted somewhere and I can't find it.
Code: Select all
OpenWindow(0,0,0,322,150,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"EditorGadget") And CreateGadgetList(WindowID(0))
EditorGadget (0,8,8,306,133,#PB_Container_Raised)
SendMessage_(GadgetID(0), #EM_SETTARGETDEVICE, #NULL, 0) ; Set wordwrap in comment
LdbInit()
LdbCreate("C:\test.txt","Name")
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
LdbInsertRecord(-1)
LdbWrite(1,GetGadgetText(0))
Delay(5000) ; Small delay before duplicating this record.
LdbInsertRecord(-1)
LdbWrite(1,GetGadgetText(0))
LdbSaveDatabase()
LdbCloseDatabase()
Code: Select all
OpenWindow(0,0,0,322,150,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"EditorGadget") And CreateGadgetList(WindowID(0))
EditorGadget (0,8,8,306,133,#PB_Container_Raised)
SendMessage_(GadgetID(0), #EM_SETTARGETDEVICE, #NULL, 0) ; Set wordwrap in comment
LdbInit()
LdbOpen("d:\test.txt")
LdbSetPointer(1)
SetGadgetText(0, "1 - " + LdbRead(1))
Delay (5000)
ClearGadgetItemList(0)
LdbSetPointer(2)
SetGadgetText(0, "2 - " + LdbRead(1))
LdbSaveDatabase()
LdbCloseDatabase()
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
I might have to disassemble the text file with a hex editor too see if there is an embedded, hidden char somewhere.