Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,576 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,881 people online right now. Registration is fast and FREE... Join Now!




Button function. loop

 
Reply to this topicStart new topic

Button function. loop, How to change function of a button temporarly

nathounathou
25 Sep, 2008 - 08:27 PM
Post #1

New D.I.C Head
*

Joined: 25 Sep, 2008
Posts: 1

I working on a program named F1m! I ve got a problem and i cant find the solution! crazy.gif

here's my problem :
I just want to change what the "okclicked" do!
Because if i test the program like that, the "okclicked" do everytime the same action
Like when the program ask the user "What do you want to do now "(look at the bottom of the code),
the user answer in the text box and click "OK!". then the program start again at the label 30! I actually want the program to go to 140 THIS time. icon_down.gif

If someone have the solution that will be realy cool! icon_up.gif
Thanks by advance smile.gif

here's a part of the code

CODE


    WindowWidth = 1020
    WindowHeight = 760
    UpperLeftX = 0
    UpperLeftY = 0
    button #main.ok, "OK!", [okClicked], UL, 705, 630
    textbox #main.field, 500, 630, 200, 25
    statictext #main.label, "Hello my name is BOV What is your name? ", 70, 630, 430, 44

    open "Bov's core" for graphics as #main
    loadbmp "aBitmap", "bov.bmp"

    'draw the bitmap named aBitmap at position 50, 50 and flush it

    print #main, "drawbmp aBitmap 0 0"
    print #main, "flush"


      'send the trapclose command
    print #main, "trapclose [quit]"
    input var$
[waitHere]  'now stop and wait
    input var$
    goto [quit]

[okClicked]  'OK! was clicked.  Get the contents of the entry field

    'print a command to the textbox
    print #main.field, "!contents?"
    'now get the contents from the textbox
    input #main.field, name$

    'now pop up a notice saying what was in the textbox

30 print #main.label,"Hello "; name$
timer 2000, [threeSeconds9]
        wait
       [threeSeconds9]

      timer 0
33 print #main.label,"I have been made by a stupid human."
timer 2000, [threeSeconds10]
        wait
       [threeSeconds10]

      timer 0
34 print #main.label,"My creator is Nate, he smokes a lot but he is realy nice with me."
timer 3000, [threeSeconds11]
        wait
       [threeSeconds11]

      timer 0
35 print #main.label,"I am able to do a lot of thing, like opening a window on your computer, or just having a conversation with you "; name$
timer 4000, [threeSeconds12]
        wait
       [threeSeconds12]

      timer 0
   print #main.label,"-------------------------------------------"



130 print #main.label, "What do you want to do now ";name$
    input #main.field, OBJ$
140 print "that seems realy cool "; OBJ$; " I realy would like to be able to do that"

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 12:10AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month