I have it working ok, but notice corruption of the text - repeated text and gibberish after saving sometimes.
It would be nice to have certain words within the editor change color, is that easy to accomplish? And some dotted lines to indicate words in the same column.
Thanks in advance

Saving code:
Code: Select all
Case #MenuItem_SaveAs
StandardFile$ = "TestProg.txt"
Pattern$ = "Text (*.txt)|*.txt|All files (*.*)|*.*"
Pattern = 0 ; use the first of the three possible patterns as standard
File$ = OpenFileRequester("Choose file to save", StandardFile$, Pattern$, Pattern)
If File$
If OpenFile(0,"TestProg.txt")
WriteString(0,GetGadgetText(Editor_0))
CloseFile(0)
EndIf
EndIf
Code: Select all
Case #MenuItem_Load
StandardFile$ = "TestProg.txt"
Pattern$ = "Text (*.txt)|*.txt|All files (*.*)|*.*"
Pattern = 0 ; use the first of the three possible patterns as standard
File$ = OpenFileRequester("Choose file to load", StandardFile$, Pattern$, Pattern)
If File$
If ReadFile(0,"C:\Programming\TestProg.txt")
*mem = AllocateMemory(Lof(0))
ReadData(0, *mem, Lof(0))
SetGadgetText(Editor_0, PeekS(*mem))
EndIf
EndIf