That seems to happen alot with us Steve.
I should also note here, that Sayzer's examples will work just fine too.
Just different ways to skin a dog.
(sorry, I'm a cat person)
<br>
That seems to happen alot with us Steve.
I should also note here, that Sayzer's examples will work just fine too.
Just different ways to skin a dog.
(sorry, I'm a cat person)
<br>
DT
here we say... every road leads to Roma.
Why? i don't know... but why skin a cat as well![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Since I am still learning,
with the information above, will the "return" go back to FOR loop in the example below ?
I guess it will, but I also do not like to guess.
Code:i VAR BYTE main: FOR i = 0 TO 4 BRANCHL i,[subName0, subName1, subName2, subName3, subName4] NEXT i GOTO main subName0: RETURN subName1: RETURN subName2: RETURN subName3: RETURN subName4: RETURN
mister_e, you are also my teacher as you know!![]()
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
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...
Last edited by mister_e; - 18th November 2006 at 18:34.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Originally Posted by mister_e
Did you mean the example in post #9 ?
-----------------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
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.
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.
Originally Posted by guest_05
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
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.
Bookmarks