Arrays are not working in ESP Basic 3.0.Alpha 69
Posted: Tue Dec 27, 2022 1:15 pm
Hi Mike,
I'm a newbie for programming with your ESP Basic, I'm trying to program for me a short program which will save some values in a array, but it doesn't work.
I have try both versions to dim the array, but I can't fill the arrays with values. Here are my code:
memclear
dim date_array(20) as string
dim time_array(20) as string
dim alter_wert(20) as string
x = 0
zaehler = 1245
nenner = 90
' gosub [zaehler_wandeln]
io(po,d1,1)
interrupt d1, [change]
textbox zaehler
textbox nenner
button Speichern, [delete]
wait
[change]
if io(laststat,d1) = 0 then
delay 100 ' 100ms warten
' print "Pin is High"
nenner = nenner + 1
if nenner > 99 then
zaehler = zaehler + 1
nenner = 00
endif
if nenner <10 then
nenner = "0" & nenner
endif
endif
wait
[delete]
x = x + 1
print x
alter_wert(x) = zaehler & "." & nenner
date_array(x) = time("day-month-year")
time_array(x) = time("hour:min")
textbox date_array(x)
textbox time_array(x)
textbox alter_wert(x)
wait
end
Thanks in advance for your time and help,
Christoph
I'm a newbie for programming with your ESP Basic, I'm trying to program for me a short program which will save some values in a array, but it doesn't work.
I have try both versions to dim the array, but I can't fill the arrays with values. Here are my code:
memclear
dim date_array(20) as string
dim time_array(20) as string
dim alter_wert(20) as string
x = 0
zaehler = 1245
nenner = 90
' gosub [zaehler_wandeln]
io(po,d1,1)
interrupt d1, [change]
textbox zaehler
textbox nenner
button Speichern, [delete]
wait
[change]
if io(laststat,d1) = 0 then
delay 100 ' 100ms warten
' print "Pin is High"
nenner = nenner + 1
if nenner > 99 then
zaehler = zaehler + 1
nenner = 00
endif
if nenner <10 then
nenner = "0" & nenner
endif
endif
wait
[delete]
x = x + 1
print x
alter_wert(x) = zaehler & "." & nenner
date_array(x) = time("day-month-year")
time_array(x) = time("hour:min")
textbox date_array(x)
textbox time_array(x)
textbox alter_wert(x)
wait
end
Thanks in advance for your time and help,
Christoph