Another Thing I Can't Figure Out

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
NoSmoke
Posts: 23
Joined: Wed Feb 07, 2007 2:24 am
Location: Calgary, Alberta, Canada

Another Thing I Can't Figure Out

Post by NoSmoke » Wed Jan 27, 2010 4:05 am

Can anyone please tell me why the following code produces the "Error 46" below? If the first line is removed or, if in the third line, CRun is changed to BRun, or, if Boolean in the first line is changed to Integer, it works.

I've searched both SF and MPLAB docs and can find no mention of the Error 46 message


Dim AEnable as Boolean
Dim BRun, CRun as Boolean
CRun = false


Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Documents and Settings\MicroChip\My Documents\SwordFish Progs\x.COF".
Clean: Done.
Executing: "C:\Program Files\Mecanique\SwordfishSE\SESwordfish.exe" x.bas -p18F4520
Swordfish BASIC Compiler (SE) 2.1.0.2 Copyright (c) 2007 Mecanique
All Rights Reserved.
Hint[] C:\Documents and Settings\MicroChip\My Documents\SwordFish Progs\x.bas 2 : Identifier 'AEnable' is declared but never used
Hint[] C:\Documents and Settings\MicroChip\My Documents\SwordFish Progs\x.bas 3 : Identifier 'BRun' is declared but never used
[Error](46): ' M-1_U01 ' not found
BUILD FAILED: Tue Jan 26 21:02:30 2010

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Wed Jan 27, 2010 9:04 am

Looks like a compiler bug.
if you put all three on the same line it works.

Code: Select all

//Dim AEnable as Boolean
Dim AEnable, BRun, CRun as Boolean
CRun = false 
maybe a pb du to the optimizer !!!

Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

Post by Francis » Wed Jan 27, 2010 9:44 am

I have had similar oddities.
Sometimes having to move declarations around, or having to put each on a separate line.

A bit annoying but entirely workaroundable.

David B. gave me an explanation some months ago on the Forum - I think that was one of the last times he appeared here. A pity.

NoSmoke
Posts: 23
Joined: Wed Feb 07, 2007 2:24 am
Location: Calgary, Alberta, Canada

Post by NoSmoke » Wed Jan 27, 2010 7:33 pm

octal wrote:Looks like a compiler bug.
if you put all three on the same line it works.

Code: Select all

//Dim AEnable as Boolean
Dim AEnable, BRun, CRun as Boolean
CRun = false 
Yes, that's what I finally did to resolve the problem
maybe a pb du to the optimizer !!!
pb?

NoSmoke
Posts: 23
Joined: Wed Feb 07, 2007 2:24 am
Location: Calgary, Alberta, Canada

Post by NoSmoke » Wed Jan 27, 2010 8:00 pm

Francis wrote:I have had similar oddities.
Sometimes having to move declarations around, or having to put each on a separate line.

A bit annoying but entirely workaroundable.

David B. gave me an explanation some months ago on the Forum - I think that was one of the last times he appeared here. A pity.
I would say more than a bit annoying as I blew almost two hours trying to narrow the problem down and, find the error definition (which I still haven't).

I wonder if there is an itemization anywhere of other compiler quirks or bugs that might save a SF novice from wasting a lot of time in future?

As far as other oddities go, I still get "END expected" errors for which I have to shuffle code around to correct and have not yet quite figured out what the rules are.

Anyhow, thanks all for your help........

Post Reply