English
Examples

Gewichtskontrolle

 
- Page 1 -



Micha12334
Hello people, I tried time a simple App to Gewichtskontrolle, to Discussion and to view To edit.
Schreib, What is badly, zerreißt it, what could one rather make. i know, what first thing comes: clinging enfernen,....ok comes yet.
have everything on my tab Lenovo 2 and Samsung s6 tested. goes so to some extent... (Lenovo = A:5.01, s6= A:5.1.1)
//
// InfinityProfan Program
// Gewichtskontrolle v0.0.1
// created 2016-01-24
var grid  =gui.grid(gui.hwnd,[2,5])
var Text1 = "Gewichts- \n control \n  in (kg)  on the: "
var altg  = float(altg)
var neug  = 0.00
var diff
var neug  = float(neug)
var time1 = time(7)
var time2
var E
//var btnE  = gui.button,[grid,2,5],"AUS",end
altg = file.read("gewicht.txt")
time2= file.read("datum.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("gewicht.txt",neug)
            file.write("datum.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.box " ON  WIEDERSEHEN ",zero,["OKAY"],zero,E
    sleep 5000
    end

endproc


99 kB
Hochgeladen:02/23/16
Downloadcounter170
Download
103 kB
Hochgeladen:02/23/16
Downloadcounter126
Download
114 kB
Hochgeladen:02/23/16
Downloadcounter128
Download
118 kB
Hochgeladen:02/23/16
Downloadcounter132
Download
 
02/23/16  
 



 
- Page 1 -



Micha12334
- The problem with the Eingabebox exit by me on. I shoved it on my Android...
i see with the whom Übereinanderlegen the Textcontrols not.
diff lying on 2,4 and neug with 1,5. What is here wrong?
the sleep I will to your suggestion Change.
I thanks you for speedy response. such corrections are a large Help for me.
Micha12333
 
02/23/16  
 



@Micha:

with

msg.box " ON WIEDERSEHEN ",zero,["OKAY"],zero,E

understand I E not because e in Your example on no procaddr shows.
msg.box "Titel","Text","OK","VorgabeText",@myProc

proc myproc(btn,txt)

    print "Es watts Button "+st(btn)+" chosen and the inputted Text sounds: "+txt

endproc


@Karl: should I sleep vlt. rather to dev.thread.sleep move out from the root?

msgbox
sleep
end

lead Yes only moreover, that 5 sec long no msgbox showing can and thereafter same terminates.
 
02/23/16  
 




Micha12334
Yes Karl, show me Please, How the goes. I teste this with a timer....

the "E" I had forgotten rauszuhauen. sometimes happens so what on the late evening.....
 
02/24/16  
 



HofK (23.02.2016)
strange:

The Eingabedialog Box with OKAY appear twice, the
dialog "Gewicht is gespeichert" not.



must it, the proc1 missing The Auswertung the Parameter ctrl state -

only State==1 ought to tappt im dunkeln trigger.

state=0: draufgetatzt
state=1: weggetatzt (on state 1 Verify for Click!)
state=2: weggetatzt outside "Button" (User has differently decided)
 
02/24/16  
 




HofK
the gui.Text with the Stati 0, 1, 2 was well not yet documents?
sound but logical.

@Micha:
gui.Text [grid,s,z] "irgendwas"
created on the Gridzelle each one new Textcontrol.
The commands supply too a handle the Controls back. the can/ought to one itself with want (is here given) in a variables z.B. hTxt remember. The Text self is first empty ("").

var hTxt=gui.Text [grid,2,4] ""

want one now Text the bestehende Textcontrol bring, then mus with gui.Text not the handle of an Gridzelle, separate the lever one existing Textcontrols indicated go. means here z.B. hTxt.

gui.Text hTxt "irgendwas anderes"

in your example could one see, as inputted numbers really übereinander "gezeichnet" go, there You in the course several Textcontrols on the identischen cell beget if one new Inputs power. too calm for special effects.

your "Fehler" have so did i self first made.  [...]  my Einwand was then, a extra commands gui.settext to have, the only on Textcontrols without Error Message durchgeht.

but How always - it has to- and detriments. David must weigh.
 
02/24/16  
 




Micha12334
right many Thanks on you,
the help me moreover what about me Have dazugelernt!
therefore publish so did i my small Test. 'Learn by doing' is the Motto for me.
Micha12334
 
02/24/16  
 




Micha12334
Hello people, have the Programmchen "Gewichtskontrolle" revised.
I faith, so could one it release:
// InfinityProfan Program
// new-g v0.0.1
// created 2016-02-29
grid  =gui.grid(gui.hwnd,[2,5])
Text1 = "Gewichts- \n control \n  in (kg)  on the: "
time
altg  = 0
neug  = 0.00
time1 = time(7)
altg = file.read("masse.txt")
time2= file.read("heute.txt")
gui.background(grid,rgb(0,0,100))
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(0,0,100))
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 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

            if diff < 0

                gui.background([grid,1,4],rgb(150,50,50))
                gui.background([grid,2,4],rgb(150,50,50))

            endif

            if diff > 0

                gui.background([grid,1,4],rgb(50,150,50))
                gui.background([grid,2,4],rgb(50,150,50))

            endif

            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

    case btn==1 : proc2

endproc

proc proc2

    end msg.box " ON  WIEDERSEHEN ",zero,["bye"]

endproc


testing it self once and schaut to bugs and Optik-.....
 
MS
03/01/16  
 



be already on the drüberstürzen -

quasi with toothbrush and Duschkopf in the hand. ^^

here one Vertipper sure: diff = round(diff,[3]) instead of round(diff,3)

hint: with function long a String To long force z.B. for: mywert=long(file.read("file")) or. mywert=long file.read "file"

Mist, must long ago go... to date evening!
 
03/02/16  
 



 
- Page 2 -



HofK
with
proc proc2

end msg.box " ON WIEDERSEHEN ",zero,["bye"]
endproc


would possible better:

msg.toast " ON WIEDERSEHEN "
end
 
03/02/16  
 




Micha12334
Yes, with toast and box have already rumgespielt. Toast sees on the Samsung s6 rather from, lose itself but on my Tablet. there is Box rather. the lying sure on whom Größenverhältnissen zueinander....
 
03/02/16  
 




HofK
The difference becomes by me ( Galaxy note 2 in the Landscape) of dialog überdeckt and is then not visible.
 
03/02/16  
 




Micha12334
would it something bring, "screen.rotation.top" einzufügen?
Perhaps could so did i whom dialog Change...
 
03/02/16  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

14.998 Views

Untitledvor 0 min.
DB HoKi02/28/20
p.specht12/07/18
Micha1233407/08/17
bloniTec08/30/16
More...

Themeninformationen

this Topic has 3 subscriber:

Micha12334 (7x)
HofK (5x)
iF (4x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie