Button command, definition badly worded !?!


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default Button command, definition badly worded !?!

    Hi, I have been reading the BUTTON definition and its still givin me a headack. Unlike a gosub, when it terminate itself with the END command, there is nothing to show where the BUTTON action ends.
    This is the example in the Pic basic manual:

    Loop: BUTTON Bpin,1,10,5,B0,0,notp
    Serout SO,N2400,["Press",13,10] '

    notp: Serout SO,N2400,[#B0,13,10]
    Pause 100
    Goto Loop


    If I was to add lines after the Pause 100, How would I know that it is included in the notp: or not. It would be much easier to end the notp: with an End :ie

    notp: Serout SO,N2400,[#B0,13,10]
    Pause 100
    End 'of course I made that up!
    ....
    CODE here
    ...
    Goto Loop

    Other wise it will think the CODE is to be executed withing the button parameter.

    Can someone clear me out on this one ?

    K

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Humm, nobody yet.

    Ok basically I want to replace a, If Then loop with a button.
    If hten loop and an ENDIF to terminate it. But BUTTON, has nothing to end it so thats where the problem is.

    Any suggestions on how to terminate a BUTTON command ??

    K

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Hi, Ken

    What else to tell you ... ???

    you had a look to the " official example " ...

    just consider BUTTON like the asm BTFSS or BTFSC command ... that here jumps to label if condition is NOT true.
    ELSE continue next line.

    that's you to care to the program flow ...

    remember programming the old HP 19/29/41 calculators ??? ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts