Forum & Help | | | | - Page 1 - |
| | selected Source The Eurer opinion to functions müssten,
But evident not do.
Sozusagen is this one beforehand-Subject to Infinity-Bugs etc. |
| | | | |
| | | | - Page 5 - |
| | | @Klaus:
there's one Error in your code:
btn btn.1= btn.2=
the alleinstehende btn |
| | | | |
| | Micha12334 | really is it normal code, nicht's particularly, look time Please on it. .
grid =gui.grid(gui.hwnd,[2,5])
Text1 = "Gewichts- \n control \n in (kg) on the: "
altg = float(altg)
neug = 0.00
neug = float(neug)
time1 = time(7)
altg = file.read("masse.txt")
time2= file.read("heute.txt")
gui.background(grid,rgb(50,50,50))
gui.background([grid,1,2],rgb(90,90,90))
gui.background([grid,2,2],rgb(90,90,90))
gui.background([grid,1,3],rgb(130,130,130))
gui.background([grid,2,3],rgb(130,130,130))
gui.background([grid,1,4],rgb(150,150,150))
gui.background([grid,2,4],rgb(150,150,150))
gui.background([grid,1,5],rgb(130,130,130))
gui.background([grid,2,5],rgb(100,0,0))
gui.Text[grid,1,1] Text1
gui.Text[grid,2,1] time1
gui.Text[grid,1,2] "Gewicht on the \n"+time2
gui.Text[grid,2,2] altg
gui.Text[grid,1,3] " Neueingabe:"
gui.Text[grid,2,3] "HIER drücken" @proc1
gui.Text[grid,1,4] "Differenz:"
gui.Text[grid,2,5] "E n D E " @proc2
proc proc1
gui.background([grid,2,3],rgb(255,255,255))
msg.box zero,zero,"OKAY","",@new
endproc
proc new btn txt
if st(btn) == 1
if txt <> 0
neug = txt
diff = altg - neug
diff = round(diff,[3])
gui.Text[grid,2,4] diff
file.write("masse.txt",neug)
file.write("heute.txt",time1)
gui.Text[grid,1,5] "Neugewicht \n= "+neug +" kg"
msg.box, " weight is stored ",zero,["OKAY"],zero,@go
endif
endif
endproc
proc go btn txt
if st(btn) == 1
proc2
endif
endproc
proc proc2
msg.toast " ON WIEDERSEHEN ",zero,["OKAY"]
end
endproc
|
| | | | |
| | Micha12334 | i know, everything yet with clinging, later make I it too without these... |
| | | | |
| | | so, Have I me snatched and begebe me on The Search... |
| | | | |
| | Micha12334 | | | | | |
| | | first of all: How cool is the because... - had not virtual that one with Infinity already meaningfully program can.
with proc1 have You The Params ctrl and state overlooking, Specifically state not ==1 ausgewertet so The msgbox 2case created watts with 1 Click aufs Text box and the proc1 fehlte global grid.
These row: msg.box, " weight is stored ",zero,["OKAY"],zero,@go corresponds to msg.box(zero," weight...
The function new fehlte global grid,neug,altg,time1.
I mean so funktionierts:
grid =gui.grid(gui.hwnd,[2,5]) Text1 = "Gewichts- \n control \n in (kg) on the: "
altg = 0 neug = 0.00 time1 = time(7) altg = file.read("volume.txt") time2= file.read("today.txt")
gui.background(grid,rgb(50,50,50)) gui.background([grid,1,2],rgb(90,90,90)) gui.background([grid,2,2],rgb(90,90,90)) gui.background([grid,1,3],rgb(130,130,130)) gui.background([grid,2,3],rgb(130,130,130)) gui.background([grid,1,4],rgb(150,150,150)) gui.background([grid,2,4],rgb(150,150,150)) gui.background([grid,1,5],rgb(130,130,130)) gui.background([grid,2,5],rgb(100,0,0))
gui.Text [grid,1,1] Text1 gui.Text [grid,2,1] time1 gui.Text [grid,1,2] "weight on the \n"+time2 gui.Text [grid,2,2] altg gui.Text [grid,1,3] " Neueingabe:" gui.Text [grid,2,3] "HIER pressing" @proc1 gui.Text [grid,1,4] "difference:" gui.Text [grid,2,5] "E n D E " @proc2
proc proc1 ctrl state
global grid if state==1 gui.background([grid,2,3],rgb(255,255,255)) msg.box zero,zero,"OKAY","",@new endif
endproc
proc new btn txt
global grid,neug,altg,time1
if btn==1
if txt!=""
neug = txt diff = altg - neug diff = round(diff,[3]) gui.Text[grid,2,4] diff file.write("volume.txt",neug) file.write("today.txt",time1) gui.Text[grid,1,5] "Neugewicht \n= "+neug +" kg" msg.box " weight is stored ",zero,["OKAY"],zero,@go
endif
endif
endproc
proc go btn
case btn==1 : proc2
endproc
proc proc2
end msg.toast " ON WIEDERSEHEN ",zero,["OKAY"]
endproc |
| | | | |
| | | and to another hint:
simply:
and so must one in a Proc not: global neug,altg,time1 write separate just global data
Structures with Infinity are integrally fine and vollautomatisch.
so can instead of:
daten=[ "neug" = 0.00 "time1" =time(7) "altg" = file.read("volume.txt") "time2" = file.read("today.txt") ] just as:
data.neug=0.00 data.time1=time(7) data.altg = file.read("volume.txt") data.time2= file.read("today.txt") . Leave
testing with print data //shows complete structure |
| | | | |
| | | so, anytime gladly further Codes The functions should! |
| | | | |
| | Micha12334 | right many Thanks for your speedy Help. at that testing the individual functions try so did i same something brauchbares on The legs To to put. this here sees on my s6 integrally well from, on the Lenovo tab 2 works it something lost. If then too Resize for Font etc. moreover comes, can already vergleichsweise something for Android do.... a lovely evening yet... |
| | | | |
| | HofK | iF (29.02.2016)
@Klaus:
there's one Error in your code:
btn btn.1= btn.2=
the alleinstehende btn
there having we whom lettuce, in your default [...]
$alias gray1 rgb 50 50 50
$alias gray2 rgb 90 90 90
var grid=gui.grid gui.hwnd,[1,3]
var grid2=gui.grid [grid,1,3],[3,3]
var grid3=gui.grid [grid2,1,3],[3,1]
var btn
btn.1=gui.myButton [grid2,1,1] "Befehls- Referenz"
btn.2=gui.myButton [grid2,3,1] "IDE Starten"
...
have I to the erfreulichen message the var obsolet is, this radical removes. var btn went and btn.1=... was/is then too ok.
having then too only with btn1 = ... without point and without vorheriges var btn experimentiert.
Fazit: no var More, but with new Variable always something allocate? if need be btn = zero
|
| | | | |
| | HofK | quick tested:
with btn= zero comes something and then the Error, with
btn = ["1" "2"] btn.1 = gui.something left "Tipp on it \n- accused weg" btn.2 = gui.something right "Touch hier"
comes no Error More. |
| | | | |
| | | Jau.
means:
corresponds to zero[0]=10 -
is then (naturally) receipting with a Instruction Error.
Redeklarieren to a aray simply by:
If a variable gänzlich unverwendet is then reicht but a simple usage:
|
| | | | |
|
AnswerTopic-Options | 49.171 Views |
Themeninformationenthis Topic has 5 subscriber: |