Avoiding too many GOSUBs, possible?


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Avoiding too many GOSUBs, possible?

    MY code that produced the printout in #4 called digit 1 ,2 and 3 subs [c1 c2 c3 ]as needed when the input is broken down

    Name:  Untitled.jpg
Views: 15871
Size:  110.2 KB
    Warning I'm not a teacher

  2. #2
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: Avoiding too many GOSUBs, possible?

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

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    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, 12:03
  2. Line Following, Obstacle Avoiding , and Victim Finding
    By cryptex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th June 2011, 16:34
  3. Avoiding getting stuck in a loop
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2008, 11:41
  4. variables and gosubs???
    By guest_05 in forum mel PIC BASIC Pro
    Replies: 38
    Last Post: - 19th November 2006, 02:46
  5. cancelling gosubs
    By rossfree in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 21st February 2005, 18:15

Members who have read this thread : 1

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