Post by wexhammer on Nov 21, 2019 11:56:13 GMT -5
To shorten up the code on my previous project i want to rid the code for the spinner control as i am not keen on the automatic comas being added when the numeral value is over 1000. I have added a plus button instead, when clicked i want the text box to go up a numeral each time. For example 1 then 2 then 3 then 4 and so on each time i click the plus button. My code is working but only prints 1, how would i achieve what i am looking for?
print #1.3, val("1")
nomainwin
UpperLeftX = 250
UpperLeftY = 100
WindowWidth = 400
WindowHeight = 450
'make sure file exists
open "savedData.txt" for append as #3
close #3
'read from file
open "savedData.txt" for input as #3
if not(eof(#3)) then
line input #3,value1$
line input #3,value2$
end if
close #3
textbox #1.1, 90, 20, 40,20
textbox #1.2, 90, 110, 40,20
textbox #1.3, 90, 210, 40,20
button #1.exit, "Save",[save],LR,30,30,55,35
'bmpbutton #1.image, "a.bmp", [abutton], UR, 50, 30
button #1.plus, "+", [plus], LR 80, 50, 24, 76
open "Splash Screen" for window as #1
''#1.image "disable"
print #1.1, value1$
print #1.2, value2$
op1=val(value1$)
op2=val(value2$)
op3=10
res=(op1+op2)*op3
print #1.3, res
wait
[plus]
print #1.3, val("1")
wait
[save]
'get texbox content
#1.1 "!contents? value1$"
#1.2 "!contents? value2$"
#1.3 "!contents? value3$"
'save textbox content
open "savedData.txt" for output as #3
print #3,value1$
print #3,value2$
print #3,value3$
close #3
'-------------------------
wait
'[abutton]
'wait