variables and gosubs???


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    In your example the return won't work as Branch(l) use Goto. It's just a Select CAse goto.. or kind of

    I wonder why Branch(l) don't use gosub so far... easy to modify the macro but...

    Did you mean the example in post #9 ?


    -----------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes indeed... post #9

    The various BRANCH?xxx and BRANCHL?xxx macros, mess around BIT?GOTO and L?GOTO

    EDIT: also ... TABLE?C
    Last edited by mister_e; - 18th November 2006 at 18:58.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Oct 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Smile

    Ahhhhhh!!! what a cleaver way to do it!!! thanks so much Darrel.

    I would never have thought about using an array like that

    Cheers.

    Now i just have to find out if im using the code the right way lol

    (p.s based on the code you gave me, how much more code could a 16f628 allow?)

    and one more question, im trying to use this code to make a sort of clock.

    i'm using the pins LOW to make the circuit, but i dont really want to use HIGH to stop the circuit, is there anway to just turn the pin off, like when the program is run at the start?
    Thanks again

    Ta.
    Last edited by guest_05; - 18th November 2006 at 19:00.

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by guest_05
    ....

    (p.s based on the code you gave me, how much more code could a 16f628 allow?)

    Ta.


    DT's code is 58 words; you have about 2048 words in 628.


    mister_e, in this case, can I make a conclusion as

    "return" in a subroutine referred by a BRANCHL inside a WHILE will take the subroutine back to that WHILE statement.

    But, this is not true for a FOR loop.


    Am I right?


    -------------------------
    Last edited by sayzer; - 18th November 2006 at 19:01.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Nope... a return will never work with Branch(L) anyway, as Branch(l) use goto.

    Branch index,[Label1, Label2,Label3] is something like ...
    Code:
    Select CASE index
        Case 1 : goto Label1
        Case 2 : goto Label2
        Case 3 : goto Label3
        End Select
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

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