If ... Then Gosub <> If ... Then Goto?


Results 1 to 7 of 7

Threaded View

  1. #7
    oldtoddler's Avatar
    oldtoddler Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    Quote Originally Posted by Melanie
    To keep track of IF...ENDIF, or indeed any other block statements which themselves could be nested (such as FOR...NEXT, or WHILE...WEND) it's convenient to indent the code for every block statement.

    This way you can easily track the preceeding IF statement associated with any corresponding ENDIF by just following the indented block.
    Yep, this is how I do it.. I use only one space instead of tab.. way too many nested loops and whiles to fit in one line.. there you can find 5.. Wonder if there is any limit for loop levels?

    -->8-- <klipeti> --
    Code:
      IF Mode then GoSub lcd	'				| |
      ADCIN AN3,IM			'				| |
      IF IM < 512 Then		' Virta ei vielä yli 0A		| | if_11
       ADCIN AN1,VM			' Mitataan jännite		| | |
       IF VM > Vp90 Then		' Jos yli +270V (90% * 300V)	| | | if_6
        Reg=1			' Regulaattori IGBT päälle	| | | |
        wr_fet=0			' 				| | | | 
        PULSOUT WR_FET,latch	' 				| | | | 
          				'		 		| | | |
        Ikkunassa=1			'	 			| | | |
        While Ikkunassa		'				| | | | we_7
         IF Mode then GoSub lcd 	'				| | | | |
         ADCIN AN1,VM		'	 			| | | | |
    > Why is Yoda wearing rubber gloves whilst doing hand-puppet Rabbit impressions?...

    Well.. Maybe it has something to do with climate change.. o:-)
    As u know, Yoda comes from clean-air environment and he was fotographed in L.A... :-)
    Last edited by oldtoddler; - 27th February 2006 at 12:55.

Similar Threads

  1. Graphic LCD with PICbasic pro
    By amindzo in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th November 2012, 12:45
  2. Making a menu
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 36
    Last Post: - 12th November 2008, 20:54
  3. Problems with RC2 and RC3
    By Christopher4187 in forum General
    Replies: 11
    Last Post: - 29th May 2006, 18:19
  4. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 21:10
  5. ds1307 from f877 to f452 not work
    By microkam in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th July 2005, 01:02

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