Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20563

BASCOM-AVR : Gosub vs. Call a procedure : REPLY

$
0
0
Hi I have some question concerned with Sub in this example below: I have a local variable in Sub1, and after I call Sub2, A value reset to zero, so how to keep value of A in this case? Regards. Hoang. [code:1:7bd5119134]Declare Sub Sub1 Declare Sub Sub2 Do Call Sub1 Loop Sub Sub1 Local A as byte Incr A ' A=1 Call Sub2 Incr A ' A reset to zero and it still = 1 End Sub Sub Sub2 ' Do something End Sub[/code:1:7bd5119134]

Viewing all articles
Browse latest Browse all 20563

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>