|
Post by metro on Apr 21, 2019 19:57:18 GMT -5
I'm having another "seniors moment" can any one shed some light on why I can't loop through the lines in a texteditor? thanks in advance.
[setup.main.Window]
'-----Begin code for #main
nomainwin WindowWidth = 550 WindowHeight = 410 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
'-----Begin GUI objects code
TexteditorColor$ = "white" texteditor #main.te2, 75, 132, 275, 110 texteditor #main.te1, 80, 10, 275, 110 button #main.button1," Create ",[button1Click], UL, 25, 55, 50, 25 button #main.button2,"Copy 2 Clipboard",[button2Click], UL, 140, 262, 114, 25 menu #main, "Edit" ' <-- Texteditor menu. '-----End menu code
open "untitled" for window as #main print #main, "font ms_sans_serif 10" print #main, "trapclose [quit.main]"
[main.inputLoop] 'wait here for input event #main.te1,"!cls" ; #main.te1,"textbox #dpndt.tbFirstName, 450, 52, 100, 20" #main.te1,"textbox #dpndt.tbSecondName, 450, 75, 100, 20"
wait
[button1Click] 'Perform action for the button named 'button3'
#main.te1 , "!lines n" ; #main.te2,n 'CHECK its working for n=1 to n #main.te1, "!line n linedat$" ; 'variable does not work but number will #main.te2,linedat$ next n
wait [button2Click] 'Perform action for the button named 'button4' 'Insert your own code here wait
[quit.main] 'End the program close #main end
|
|
|
Post by metro on Apr 21, 2019 22:53:15 GMT -5
🤦🏻♂️ don't get old changed code line ........ #main.te1, "!line "; n ;" linedat$" 'global linedat$'
[setup.main.Window]
'-----Begin code for #main
nomainwin WindowWidth = 550 WindowHeight = 410 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
'-----Begin GUI objects code
TexteditorColor$ = "white" texteditor #main.te2, 75, 132, 375, 110 texteditor #main.te1, 80, 10, 375, 110 button #main.button1," Create ",[button1Click], UL, 25, 55, 50, 25 button #main.button2,"Copy 2 Clipboard",[button2Click], UL, 140, 262, 114, 25 menu #main, "Edit" ' <-- Texteditor menu. '-----End menu code
open "untitled" for window as #main print #main, "font ms_sans_serif 10" print #main, "trapclose [quit.main]"
[main.inputLoop] 'wait here for input event #main.te1,"!cls" ; #main.te1,"textbox #dpndt.tbFirstName, 450, 50, 100, 20" #main.te1,"textbox #dpndt.tbSecondName, 450, 75, 180, 20" #main.te1,"textbox #dpndt.tbSurnameName, 450, 100, 180, 20"
wait
[button1Click] 'Perform action for the button named 'button3' #main.te1 , "!lines n" ;
for n=1 to n #main.te1, "!line "; n ;" linedat$" if linedat$ <> "" then call CreateFields$ linedat$ end if next n wait
[button2Click] 'Perform action for the button named 'button4' #main.te2, "!selectall" #main.te2,"!copy" wait
[quit.main] 'End the program close #main end
sub CreateFields$ linedat$ hndlename$=upto$(linedat$,",") hndlname$= AFTER$(hndlename$ ,"textbox") 'hndl$=upto$(fldname$,".") fldname$=after$(hndlname$,".") final$=hndlname$+", "+chr$(34)+"!contents? "+fldname$+"$"+chr$(34) #main.te2, final$ end sub
|
|