A PBasic routine How would you write it to do the same thing in Spin
sam_sam_sam
Posts: 2,286
Here is the routine
Thanks to anyone that can help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 4/27/2010 2:03:36 PM GMT
' {$STAMP BS2} ' {$PBASIC 2.5} chg VAR IN0 cntr VAR Byte ' The table is [color=red]IF Chg = 1 Then Loop = 100[/color] [color=blue]If Chg = 0 THEN Loops = 0 [/color] DO cntr = cntr + 1 * Chg IF (cntr = 100) THEN EXIT ' Exit or to a subroutine LOOP
Thanks to anyone that can help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 4/27/2010 2:03:36 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
input_pin = 3
var
long ctr
Pub main
dira[noparse][[/noparse]input_pin]~
repeat until ctr == 100
ctr += ina[noparse][[/noparse]input_pin]
John Abshier
I want to Thank John Abshier for his help
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Jonny Mac
Thank you for your reply
How ever EXIT is not a commmand in Spin· what command would be close to a EXIT command that is used·in PBasic
What I want to do·is to write a routine in Spin as a Oject·that will do the same thing as it dose in a·PBasic routine
with a Debug so·I can see the state change and see the counter going up in this object
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·Now wanting to learn Spin· Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 4/27/2010 7:15:34 PM GMT
I think you just go back one indentation:
I'm not sure though
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
Here an example with a subroutine that has a parameter mode, which switches btween first and second version.
Andy