English
Forum

at that Taschenrechner program! Kapier there what not. or. can Error not understand

 
- Page 1 -



Gary12345
Hi,
CompileMarkSeparation
Window 0,0-400,400

Proc Hauptprogramm

    declare wert%, wert2%, wert3%, wert4%, wert5%, wert6%, wert7%, wert8%, wert9%, wert10%
    var Button1& = CREATE("Button",%HWND,"1", 50, 50, 50, 50)
    var Button2& = CREATE("Button",%HWND,"2",50, 100, 50, 50)
    var Button3& = CREATE("Button",%HWND,"3",50,150,50,50)
    var Button4& = CREATE("Button",%HWND,"4",50,200,50,50)
    var Button5& = CREATE("Button",%HWND,"5",50,250,50,50)
    var Button6& = CREATE("Button",%HWND,"6",100,50,50,50)
    var Button7& = CREATE("Button",%HWND,"7",100,100,50,50)
    var Button8& = CREATE("Button",%HWND,"8",100,150,50,50)
    var Button9& = CREATE("Button",%HWND,"9",100,200,50,50)
    var Button10& = CREATE("Button",%HWND,"0",100,250,50,50)
    var Button11& = CREATE("Button",%HWND,"+",200,50,50,50)
    var Button12& = CREATE("Button",%HWND,"-",200,100,50,50)
    var Button13& = CREATE("Button",%HWND,":",200,150,50,50)
    var Button14& = CREATE("Button",%HWND,"*",200,200,50,50)
    var Button15& = CREATE("Button",%HWND,"=>",200,250,50,50)
    var ButtonClear& = CREATE("Button", %HWND, "TEST100", 250,100,100,100)

    While 1

        WaitInput

        If clicked(Button1&)

            wert% = 1
            Print wert%

        EndIf

        If clicked(Button2&)

            wert2% = 2
            print wert2%

        EndIf

        If clicked(Button3&)

            wert3% = 3
            print wert3%

        EndIf

        If clicked(Button4&)

            wert4% = 4
            print wert4%

        EndIf

        If clicked(Button5&)

            wert5% = 5
            print wert5%

        EndIf

        If clicked(Button6&)

            wert6% = 6
            print wert6%

        EndIf

        If clicked(Button7&)

            wert7% = 7
            print wert7%

        EndIf

        If clicked(Button8&)

            wert8% = 8
            print wert8%

        EndIf

        If clicked(Button9&)

            wert9% = 9
            print wert9%

        EndIf

        If clicked(Button10&)

            wert10% = 0
            print wert10%

        EndIf

        If clicked(Button11&)

            var Ergebnis$[wert1%,wert2%,wert3%,wert4%,wert5%,wert6%,wert7%,wert8%,wert9%,wert10%] = wert%+wert2%+wert3%+wert4%+wert5%+wert6%+wert7%+wert8%+wert9%+wert10%
            print Ergebnis$

        EndIf

        If clicked(ButtonClear&)

            cls

        EndIf

    EndWhile

EndProc

While 1

    WaitInput
    Hauptprogramm

EndWhile


How I vorgegangen be:

1. have consider, whether I Buttons use should or only one Edit box. I have me for schwierigere Variante decided, namely The Buttons.
2. the Hauptprogramm in a procedure set. Externe functions go in a Extra-Proc treats.
3. any Buttons a worth allocate (naturally integer) => worth% - worth10%
4. if Button "+" pressed watts, any values add. To guter letzt tappt im dunkeln with print present let (the Result naturally)

my trouble:

1. it add everything correctly., only if I the second time add have (So the second time rechne without ClearUp) comes a Error Message, I The Variable Result twice declared have. can this Error not understand.
2. If I only once two values add and then To guter Letzt on the Button100 click, comes at second calculate too a Error Message. this is against The same How in trouble1 described.
3. I can only values 0-9 present. No values over 9. Why? Why depends it always a number drunter instead of next to the number? can I neither understand.

How your me help could

i will none Lösungscode. i will only Notes on The cause this Fehlers. what I very wrong made have and yet further others things. moreover would I the trouble not everything at a single blow make, separate everything step for step. i was it former dwelt just Codes To get, but this time I will really learn. If I what not understand, then frag I even to. but Notes instead of the whole Solution is often sinnvoller as one think.

therefore many Thanks already in advance!
 
XProfan X2
MfG
Gary12345
01/26/13  
 



 
- Page 3 -



Gary12345
it'll Yes always geiler in Your Forum
over again many Thanks.

be at Taschenrechnercode (new code) on a problem punched, will be it hopefully on my own create, the To eliminating
 
XProfan X2
MfG
Gary12345
01/27/13  
 



Weiterführendes about find You here [...]  and here [...]  . ^^
 
01/27/13  
 




Gary12345
Include in Action:
CompileMarkSeparation
 $I MatheLeicht.inc
cls
declare Summe!
var edit1! = CREATE("Edit",%HWND,"",0,0,100,100)
var edit2! = CREATE("Edit",%HWND,"",100,0,100,100)
var button& = CREATE("Button",%HWND,"Rechnen",100,100,100,100)

While 1

    WaitInput

    If clicked(button&)

        Summe! = Summe(edit1!,edit2!)
        print Summe!

    EndIf

MfG
Gary12345
01/27/13  
 



One Edit is a Control and create("edit supply one Control-lever -
these of type long -

means:
CompileMarkSeparation
var edit1& = CREATE("Edit"
>

and instead of:
CompileMarkSeparation
Summe! = Summe(edit1!,edit2!)
>

functions:
CompileMarkSeparation
Summe! = Summe(val(getText(edit1&)),val(getText(edit2&)))
>
 
01/27/13  
 




Gary12345
and you have with getText what wrong

gettext is wrong, correctly. would gettext$

Vielen Thanks!
 
XProfan X2
MfG
Gary12345
01/27/13  
 



is correct, the has one of it if mans ungetestet directly in whom Posting-Editor
pinselt.

To of my Ehrenrettung had getText without Dollarzeichen in the nativen Profan
(nProcs) utterly sufficient.
 
01/27/13  
 




Gary12345
can I,may I know, what NProcs are? is the already important for me? or first later?
 
XProfan X2
MfG
Gary12345
01/27/13  
 



The can later time thoroughly important his for you.

so can You native functions program, The having many advantages z.B.
are you for a multiple faster and thread- and APC ( [...]  ) -sure and You
can also directly in Assembler program and functions program
The z.B. faster are as wären tappt im dunkeln with C program.

You can so means your XProfan "pimpen" in the You whom Präkompilierer
XPSE to whom actual Kompilierer chid: [...] 

example: [...] 

too beautiful: [...]  , [...] 
 
01/27/13  
 




Gary12345
OK I versag already at understanding the terms. but can sure later for me important his. now progge I first on the Taschenrechner moreover

PS: BKA Remover can something last
 
XProfan X2
MfG
Gary12345
01/27/13  
 



 
- Page 4 -



Gary12345

CompileMarkSeparation
 $I MatheLeicht.inc
cls rgb (187,234,102)
declare Summe!,Minus!,Teilen!,Multiplizieren!,Wurzel!
var edit1& = CREATE("Edit",%HWND,"Zahl eingeben",0,0,100,30)
var edit2& = CREATE("Edit",%HWND,"Zahl eingeben ",150,0,100,30)
var button& = CREATE("Button",%HWND,"+ ",0,100,50,100)
var button2& = CREATE("Button",%HWND,"-",50,100,50,100)
var button3& = CREATE("Button",%HWND,":",100,100,50,100)
var button4& = CREATE("Button",%HWND,"*",150,100,50,100)
var button5& = CREATE("Button",%HWND,"Wurzel",200,100,50,100)

While 1

    WaitInput

    If clicked(button&)

        Summe! = Summe(val(getText$(edit1&)),val(getText$(edit2&)))
        print Summe!

    EndIf

    If clicked(button2&)

        Minus! = Minus(val(getText$(edit1&)),val(getText$(edit2&)))
        print Minus!

    EndIf

    If clicked(button3&)

        Teilen! = Teilen(val(getText$(edit1&)),val(getText$(edit2&)))
        print Teilen!

    EndIf

    If clicked(button4&)

        Multiplizieren! = Multiplizieren(val(getText$(edit1&)),val(getText$(edit2&)))
        print Multiplizieren!

    EndIf

    If clicked(button5&)

        Wurzel! = Wurzel(val(getText$(edit1&)))
        print Wurzel!

    EndIf

EndWhile


ready!

wished only this experiment solve and I it with Help of/ one own INCLUDE successful resolved. the Program won't published, there it sooner a Übung is as one proposition. basic principle understood. wants whom yet not further ausbauen.

Vielen Thanks all, The me helped having!

(expanse I will of these Taschenrechner not calculate.)
 
MfG
Gary12345
01/27/13  
 




Jörg
Sellmeyer
expanse have you got already:
CompileMarkSeparation
Multiplizieren! = Multiplizieren(val(getText$(edit1&)),val(getText$(edit2&)))
>
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
01/27/13  
 




Gary12345
Jo white I. will be then on of my Include weiterbasteln and if possible, still on the Taschenrechner.
 
XProfan X2
MfG
Gary12345
01/28/13  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

24.938 Views

Untitledvor 0 min.
ecki12/29/23
MrZebulon08/05/18
rawerra12/30/16
Peter Max Müller10/30/14
More...

Themeninformationen



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