Avoiding too many GOSUBs, possible?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,154


    Did you find this post helpful? Yes | No

    Default Re: Avoiding too many GOSUBs, possible?

    Thanks, but there's no code in #4?

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,689


    Did you find this post helpful? Yes | No

    Default Re: Avoiding too many GOSUBs, possible?

    you can remove all the gosubs entirely with a bit of thought to get the same printout

    Code:
    LOOPY:        FOR X = 1 TO 30
            DEBUG 13,10,DEC X,9
            GOSUB CX
        NEXT
        PAUSE 5000    
    GOTO LOOPY 
    CX:
         XX = x
         y = 0
         WHILE XX  
             DEBUG  49 + y
             y = y + 1
             if y == 3 then y = 0
             Xx = Xx - 1
             IF  XX  THEN DEBUG ","
         WEND
     RETURN
    Warning I'm not a teacher

Similar Threads

  1. Avoiding of 255 IF-THEN in the code, possible?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd September 2022, 13:03
  2. Line Following, Obstacle Avoiding , and Victim Finding
    By cryptex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th June 2011, 17:34
  3. Avoiding getting stuck in a loop
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2008, 12:41
  4. variables and gosubs???
    By guest_05 in forum mel PIC BASIC Pro
    Replies: 38
    Last Post: - 19th November 2006, 03:46
  5. cancelling gosubs
    By rossfree in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 21st February 2005, 19:15

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