Problem with WHILE - WEND


Results 1 to 23 of 23

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    1. Parenthesis are important in most case
    2. I would never jump out of a WHILE statement using a GOTO. Using a flag or Validate the Conditions to get out of the WHILE/WEND loop is, IMHO, a better practice.

    Could be also..
    Code:
    Start:
        LOW RENCA
        LOW EJECT
        While (FootSw=1) OR (Ready=1) : WEND
    OR
    Code:
    Start:
        LOW RENCA
        LOW EJECT
        SpinHere: If (FootSw=1) OR (Ready=1) then SpinHere
    You may notice that one method generate less code space than the other.
    Last edited by mister_e; - 26th May 2006 at 13:10.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. HSEROUT and Commas, What? Help Me Understand
    By altech6983 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th July 2009, 19:12
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  4. while wend problem
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 19th March 2007, 02:53
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59

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