if then problem


Results 1 to 4 of 4

Thread: if then problem

Threaded View

  1. #1
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107

    Default if then problem

    This has got to be simple but I can't see the problem. This is my code:
    if not GPIO.1 then time1 = 1 else time1 = 0
    endif
    IF not GPIO.2 THEN time2 = 2 else time2 = 0
    endif
    IF not GPIO.3 THEN time4 = 4 else time4 = 0
    endif
    if not GPIO.4 then time8 = 8 else time8 = 0
    endif
    The compiler error is: bad expression or missing THEN
    I tried putting colons in it even tho the manual doesn't say they are needed, but that was no help.

    Hmmm, I copied an IF THEN out of the manual and ran it thru the compiler, same error. What's up?

    Russ
    Last edited by Russ Kincaid; - 22nd March 2007 at 02:26.

Similar Threads

  1. problem using GOSUB under interrupt
    By fobya71 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 5th March 2010, 19:52
  2. 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
  3. Microcode Studio 18f2455 problem?????
    By volkan in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st May 2007, 21:04
  4. Hardware problem or what ?
    By Steve S. in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 4th March 2007, 21:39
  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