Sign in to follow this  
Followers 0
Norsestar

trouble with func's

2 posts in this topic

i've probably posted this several times and got no replies, so i'll try again in a 'less of a headache' way lol.

basically what i'm trying to do is, when a button is pressed on my tab, i want the gui to read what's typed in the input box and do mathematical calculations accordingly and then display the resulting answer. i.e. when i click "ok" on the deposits tab, i want it to add that amount to the current amount stored in a text file and then save it. and when "ok" is clicked in withdrawals, subtract that amount, etc...

as well, i'm trying to set it to be able to load up several different accounts to compare amounts, etc... the script is pretty much self explanatory since i have the complete gui display running, it's just lacking the functions.

any help would be appreciated, thank you

Manage_Your_Finances___Beta.zip


Education: Francis Tuttle Technology Center adult full-time studentCourse of study: Network TechnologyCurrent Course: Microsoft Windows Server 2003, Enterprise EditionCompleted Courses: CompTIA A+ Hardware and Software, Windows XP Professional, Microsoft Office 2003, Desktop Support and Troubleshooting, and CompTIA Network+Remaining Courses: Linux Administration, Copper Cabling, Microsoft Windows Server 2003, Enterprise EditionAchievements: @17 years old, scored 98th percentile U.S. in Algebra 2 and Advanced Chemistry. [i.e. Ranked top 2% in the nation of High School students]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

First off, thanks for giving me something to play with; i love when people post the code theya re working on because I can just play around with it until it works :)

i've probably posted this several times and got no replies, so i'll try again in a 'less of a headache' way lol.

basically what i'm trying to do is, when a button is pressed on my tab, i want the gui to read what's typed in the input box and do mathematical calculations accordingly and then display the resulting answer. i.e. when i click "ok" on the deposits tab, i want it to add that amount to the current amount stored in a text file and then save it. and when "ok" is clicked in withdrawals, subtract that amount, etc...

as well, i'm trying to set it to be able to load up several different accounts to compare amounts, etc... the script is pretty much self explanatory since i have the complete gui display running, it's just lacking the functions.

any help would be appreciated, thank you

As the title of your post was 'Can't get buttons to work', i figured i'd at least address that.

Just make sure each of your tab buttons have an actual variable assigned to them, like $myButton = GuiCtrlCreateButtion(...) and then you can parse them later:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        ;- Close the GUI
        Case $GUI_EVENT_CLOSE
            Exit
        
    case $tab0OK
        MsgBox(0, "", "View Deposits clicked")
    
    case $tab1OK
        MsgBox(0, "", "View withdrawls checked")
    
    case $tab30k
        MsgBox(0, "", "View pending  clicked")
    
    case $tab4OK
        MsgBox(0, "", "View accounts clicked")
    
    EndSwitch
WEnd

To work with a file, take a look at FileOpen, FileWrite and FileClose and FileRead in the help file.

To execute calculations, take a look at the Execute command as well, esp if you are putting in like '2+2' into the text file; if not then you can just read the value from the text file and add it to the variable that is read from the GuiCtrlRead and it should be enough.

As to the rest, w/o actually seeing your functions, i'm not sure how effective we all can be :)

Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0