General area when it fits no where else

Moderator: Mmiscool

User avatar
By xtal
#32877 Loaded V1.10 today

Issues still pending
#1 htmlvar not working properly
----- #a does not wan to work on string won't work on my Ipage var string SRC=Ipage
----- SRC=| wprint |Ipage| will proper display image , but changing value of Ipage elseware
---------- does not alter image display
----- SRC=| wprint htmlvar(Ipage) will not properly display
----- #b iffy working on numeric worked on cdeg0 var not on fdeg0 var
---------- <td>| wprint |htmlvar(cdeg0)| </td> works for centigrade degs
---------- <td>| wprint |htmlvar(fdeg0)| </td> NO WORK farenheit degs
---------- <td~~~~>| wprint htmlvar(adc_value) works for adc

#2 Compare issue
Code: Select all  [BLINK]
     if Ipage == B_Clo then Ipage = B_Opn else Ipage = B_Clo
    serialprintln "C = '1' on initial entry"
   if cnt == "1" then SERIALPRINTLN "1"                                --->                 both 1 and 2 print at same time
   if cnt == "2" then SERIALPRINTLN "2"
  if cnt == "2" then cnt = "1"
  SERIALPRINTLN Ipage                                                                 --->                  Ipage toggle ok, but cannot change page image

#3 Residue problem
----- The last button clicked will rerun button code upon my 15 sec resresh

#4 executing a for/next under button appears to only run 1 step of loop per wait or my 15 sec refresh

#5 info I added Fdeg button to compute Farenheit from Celcisus , because I could not figure how to add it to the ---------code so it would update
Code: Select allmycommand = " "
cnt = "1"
rfctr = 0
adc_id = 0
adc_value = 512
k1 = 0.11
p00 = 'P'
apc0 = '11111'
ppm0 = '1770'
cdeg0 = 25.1
fdeg0 = 77.18
kta0 = '0.01'
lo0 = '12'
hi0 = '20'
prb = '01.0'
ph = '7.0'
sbuf = ""

B_Opn = ''
B_Clo = ''
Ipage = B_Clo

rfh = '15'

wprint "<meta http-equiv='refresh' content='15' >"
wprint "<script type = 'text/javascript'>"
wprint "var timeInSecs;"
wprint "var ticker;function startTimer(secs){"
wprint "timeInSecs = parseInt(secs)-1;"
wprint "ticker = setInterval('tick()',1000);}"
wprint "function tick() {"
wprint "var secs = timeInSecs;"
wprint "if (secs>0) {timeInSecs--;} else {clearInterval(ticker);"
wprint "startTimer(15);}document.getElementById('countdown').innerHTML = secs;} startTimer(15);"
wprint "</script><body><div>"
wprint "<table bgcolor='Lawngreen' border='1' cellpadding='5'>"
wprint "<th><h1>ESP8266 Blinker Thing!</h1></th>"

wprint "<td><IMG SRC="
wprint "Ipage"
wprint " LEFT='1' WIDTH='120' HEIGHT='60' BORDER='1'></td>"
wprint "<th id='countdown'>15</th></table><br>"

wprint "<div><textarea name='cmd1s' cols='70' rows='14'></textarea></div><br>"
wprint "<div><textarea name='cmd2s' cols='70' rows='6'></textarea></div><br>"

wprint "<div><table bgcolor='Yellow' border='1' cellpadding='5'>"
wprint "<tr><th>Sensor</th><th>TempC</th><th>TempF</th><th>PPMcntr</th><th>PPM__</th><th>Adj__1</th><th>Adj__2</th></tr>"
wprint "<tr><td>DS18B20P</td><td>"
wprint |htmlvar(cdeg0)|
wprint "</td><td>"
wprint |htmlvar(fdeg0)|
wprint "</td><td>43708</td><td>1676</td><td>1644.9</td><td>1644.2</td></tr>"
wprint "<tr><th>Probe-K</th><th>Pool-PH</th><th>PH-Adj</th><th>ADC Value</th></tr>"
wprint "<tr><td>01.0</td><td>7.0</td><td>7</td><td bgcolor='Red'>"
wprint htmlvar(adc_value)
wprint "</td></tr></table></div><br>"

button "BLINK" [BLINK]
button "RD_ADC" [RDA.DC]
button "TEMP_DN" [TEMP.DN]
button "TEMP_UP" [TEMP.UP]
button "F_Deg" [Fdeg]
textbox mycommand
wprint "<br>


if Ipage == B_Clo then Ipage = B_Opn else Ipage = B_Clo
serialprintln "C = '1' on initial entry"
if cnt == "1" then SERIALPRINTLN "1"
if cnt == "2" then SERIALPRINTLN "2"
if cnt == "2" then cnt = "1"

AI adc_value
SERIALPRINTLN "you clicked rda dc"

SERIALPRINTLN "you clicked temp dn"
cdeg0 = cdeg0 - 0.1

SERIALPRINTLN "you clicked temp up"
cdeg0 = cdeg0 + 0.1
fdeg0 = cdeg0 * 1.8
fdeg0 = fdeg0 + 32
serialprintln fdeg0


User avatar
By Mmiscool
#32884 Hello,

Thanks again for supplying me with more bugs to fix.

Every time this happens the interpreter gets better.

the htmlvars() function should be working now. I just uploaded a new build.

This will also resolve a problem with text boxes.

As to the page refreshing and it executing the same branch as a previous button click this is working as intended. branch this is working as intended. You can use the option to redirect to "./input?" instead of refreshing the page so that the old values are not send and a button click branch is not executed.

The htmlvars() function should only be used by it self with the wprint command. No text before or after the function should be added.

wprint htmlvar(myvar) 'will work
wprint "<hr>htmlvar(myvar)" 'will not work.