News:

;) This forum is the property of Proton software developers

Main Menu

No error messages

Started by rick.curl, Jun 06, 2024, 02:43 PM

Previous topic - Next topic

rick.curl

I'm almost tempted to post this in the "beginners" section, because I haven't written any code in a while and I'm sure I'm doing something stupid wrong.
I started out writing some code for a 12F1572, and initially I just blinked an LED.  All good.  As I added more code it got to the point that the compile failed, but there were no error messages. I can't see where I have done anything to suppress the messages.
Here is a code snippet, and the offending line is the one that begins with "While ADIN 0..."

    Device  12F1572

    Xtal 4
    Reminders off
'-------------------------------------------------------------------------------
'**** Added by Fuse Configurator ****
' Use the Fuses Tab to change these settings

Config1 FOSC_INTOSC, WDTE_OFF, PWRTE_ON, MCLRE_OFF, CP_OFF, BOREN_ON, CLKOUTEN_OFF
Config2 WRT_OFF, PLLEN_OFF, STVREN_OFF, BORV_LO, LPBOREN_OFF, LVP_OFF

'**** End of Fuse Configurator Settings ****
'-------------------------------------------------------------------------------
    Reminders On

    osccon = %01101010
    CM1CON0 = 01  'comparator off
    TRISa =  %11000001
    ANSELa = %00000001  'AN0 analog, all others digital
    adcon0 = %0000001   'Enable ADC0
    adcon1 = %10110000   'Right justified, FRC, VrPos = Vdd
    adcon2 = 0

   porta = 0   'set all pins to zero
   DelayMS 100 'wait a bit before starting

  '* Define aliases *
  Symbol Green = LATa.4
  Symbol Red = LATa.5
  Symbol Relay = lata.2

'* Define constants *
  Symbol Thresh = 100   'The A/D trigger threshold
  Symbol OnDelay = 20   'the ON delay in tenths of a second
  Symbol OffDelay = 20  'the OFF delay in tenths of a second

'* Define variables*
   Dim OnPass as word
   dim OffPass as word

 clear       'clear all variables
Mainloop:
if onpass > ondelay and adin 1 > thresh then    'turn on the relay
    relay = 1
    green = 1
    red = 0
    offpass = 0
EndIf

if offpass > offdelay and adin 1 < thresh then    'turn off the relay
    relay = 1
    green = 1
    red = 0
    onpass = 0
endif
 while adin 0 > thresh and relay = 0 and onpass < Ondelay then
    toggle red
   green = 0
    inc onpass
 Wend

Can some kind soul tell me where I have gone astray?

Thank you!

-Rick

top204

#1
I've just compiled the code above and it is giving relevant error messages:

Error at Line [56]    In file [C:\Users\Les\PDS\Tests\Test_12LF1572.bas]    *** Colon Required between commands! ***
Error at Line [60]    In file [C:\Users\Les\PDS\Tests\Test_12LF1572.bas]    *** Misplaced or Incorrect 'Wend'. Also check its corresponding While Command and any comparisons inside the While...Wend! ***


The problem is the line:

While ADIn 0 > Thresh And Relay = 0 And OnPass < OnDelay Then

You have a Then directive after a While command.

I've tried it with earlier versions and the latest version of the compiler and they all give an error message in the compiler's IDE.

rick.curl

Hi Les- I did find the error- but my question is- why am I not seeing any error messages?  Have I done something to toggle them off? After I try to compile, at the bottom of the screen I see:
Saving C:\projects\Subswitch\Subswitch.bas
Compiling  C:\projects\Subswitch\Subswitch.bas

....and then nothing.  No error message, no hex file.
I'm running Compiler 4.0.4 build 0, Positron Studio 2.0.3 build 12

JonW

Rick I think this is a Bug in Positron Studio.  If you toggle windows does it show the compilation text?  I updated to 2.03 Build 13 and it was fixed.  I tried to find the installer on this site but couldn't locate it.  You can check it if you use the Mechanique IDE




rick.curl

Quote from: JonW on Jun 06, 2024, 05:06 PMRick I think this is a Bug in Positron Studio.  If you toggle windows does it show the compilation text?  I updated to 2.03 Build 13 and it was fixed.  I tried to find the installer on this site but couldn't locate it.  You can check it if you use the Mechanique IDE
Yes it does!  Thanks for the tip. I presume John has been notified, so I can use this workaround until there's an update.

Thank you!

-Rick

JonW

#5
There is an update. Build 13 on this site

 

rick.curl

Quote from: JonW on Jun 06, 2024, 09:42 PMThere is an update. Build 13 on this site
Thanks, Jon.  I installed the update and the problem is resolved.

I am active on a number of forums for a number of different products, but this is the one where the members are always the most helpful.

THANK YOU!!!

-Rick

Dolci

Quote from: JonW on Jun 06, 2024, 09:42 PMThere is an update. Build 13 on this site

 

where i can find this Build 13


John Lawton


Dolci