Post by theulimateunltd on Nov 9, 2021 13:08:32 GMT -5
Hi all,
My code doesn't run as expected.
Problem is that the sub undo in the edit menu is not accessible.
Perhaps it has to do with the structure of the file.
GLOBAL REGELX
MENU #WIN, "File", "Load from Liberty", FilefromLB, "New", FileNew, "Open", FileOpen, "Save", FileSave, _
"Save as", FileSaveAs, "Print", FilePrint, "Print Setup", FilePrintSetup, _
"Exit", FileExit
MENU #WIN, "Edit", "EditComments", EditComments, "Undo", EditUnDo, "Redo", EditReDo, "Cut", EditCut, "Copy", _
EditCopy, "Paste", EditPaste
MENU #WIN, "Help ", "Help", HelpHelp, "About", HelpAbout
TEXTEDITOR #WIN.EDT, 0, 0, 300, 301
OPEN "BaseEditor-v11" FOR GRAPHICS AS #WIN
#WIN.EDT "!autoresize"
#WIN "TRAPCLOSE Quit"
WAIT
SUB FileExit
confirm "Do you want to exit the BaseEditor ?"; quit$
if quit$ = "no" then wait
CLOSE #WIN
'END
END SUB
SUB Quit WIN$
confirm "Do you want to quit the BaseEditor ?"; quit$
if quit$ = "no" then wait
CLOSE #WIN$
'END
END SUB
SUB FileNew
NOTICE "FileNew"
END SUB
SUB EditUndo
NOTICE "Undo"
END SUB
SUB FilefromLB
dim gelezen$(0)
file$ = idefilename$()
open file$ for input as #f
i = 0
i = LeesBestand()
close #f
i = i - 1
for j = 0 to i
#WIN.EDT gelezen$(j)
next j
END SUB
sub Preserve count
dim temp$(count)
for e = 0 to count
temp$(e) = gelezen$(e)
next e
count = count + 1
redim gelezen$(count)
for e = 0 to count - 1
gelezen$(e) = temp$(e)
next e
end sub
function LeesBestand()
do while not(eof(#f))
line input#f, temp$
gelezen$(i) = temp$
call Preserve i
i = i + 1
loop
LeesBestand = i
end function
Problem is that the sub undo in the edit menu is not accessible.
Perhaps it has to do with the structure of the file.
GLOBAL REGELX
MENU #WIN, "File", "Load from Liberty", FilefromLB, "New", FileNew, "Open", FileOpen, "Save", FileSave, _
"Save as", FileSaveAs, "Print", FilePrint, "Print Setup", FilePrintSetup, _
"Exit", FileExit
MENU #WIN, "Edit", "EditComments", EditComments, "Undo", EditUnDo, "Redo", EditReDo, "Cut", EditCut, "Copy", _
EditCopy, "Paste", EditPaste
MENU #WIN, "Help ", "Help", HelpHelp, "About", HelpAbout
TEXTEDITOR #WIN.EDT, 0, 0, 300, 301
OPEN "BaseEditor-v11" FOR GRAPHICS AS #WIN
#WIN.EDT "!autoresize"
#WIN "TRAPCLOSE Quit"
WAIT
SUB FileExit
confirm "Do you want to exit the BaseEditor ?"; quit$
if quit$ = "no" then wait
CLOSE #WIN
'END
END SUB
SUB Quit WIN$
confirm "Do you want to quit the BaseEditor ?"; quit$
if quit$ = "no" then wait
CLOSE #WIN$
'END
END SUB
SUB FileNew
NOTICE "FileNew"
END SUB
SUB EditUndo
NOTICE "Undo"
END SUB
SUB FilefromLB
dim gelezen$(0)
file$ = idefilename$()
open file$ for input as #f
i = 0
i = LeesBestand()
close #f
i = i - 1
for j = 0 to i
#WIN.EDT gelezen$(j)
next j
END SUB
sub Preserve count
dim temp$(count)
for e = 0 to count
temp$(e) = gelezen$(e)
next e
count = count + 1
redim gelezen$(count)
for e = 0 to count - 1
gelezen$(e) = temp$(e)
next e
end sub
function LeesBestand()
do while not(eof(#f))
line input#f, temp$
gelezen$(i) = temp$
call Preserve i
i = i + 1
loop
LeesBestand = i
end function