[mono-vb] several vbnc error mysteries

Andy Hume andyhume32 at yahoo.co.uk
Sun Jun 14 14:33:14 EDT 2009



Jude DaShiell wrote:
> 
> The only thing I can figure for line 251 and similar lines is some binary 
> garbage got into the source code but deleting that line and keying it in 
> again hasn't cleared that error.  Several other errors in select case 
> statements all of which worked before the debian squeeze version of vbnc 
> got upgraded.
> 

Curious if the change really occurred then.  Because with both the mono and
MSFT compiler quite a few errors are reported.

The first two errors are reported to be on lines 25 and 26 (at column number
1 in each, not line 251...)
   Const Fnum As Ushort 
   Const Snum As Ushort 
The problem there is that a constant "Const" must have a value (hence the
"Expected '=' " message).  However you set these variables in the program,
so make them Private and not "Const".

At line 68, "Default:", the default case is labelled in VB with "Case Else",
so change that over.

>From line 55 to 72 there are mixed up Try, While and Case statements.  These
can't be mingled together: i.e *not*:
Try
      While
Catch
      End While
EndTry

That confuses the compiler very much. :-)


Then there are multiple places where the Console.WriteLine string doesn't
have an end quote.  Some where the line has got broken e.g. line 92
Console.WriteLine("[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[[[[[[[[[[[[[[")

oops

Then, finally for now, there are various Functions without "As" clauses,
e.g. must have "Function X() As Y" but there is no "As", since there is no
"Return" either change them to "Sub".  For instance functions: Menu, Inkey,
and ComputeP.


That'll do for now, hopefully that'll make the other errors more apparent.

BTW I'm not sure I'd recommend using vbnc only for new code.  Its error
reporting (or the lack thereof) make thnigs a little bit more difficult. :-( 
You don't have access to MSFT vbc.exe do you?

Andy
-- 
View this message in context: http://www.nabble.com/several-vbnc-error-mysteries-tp24018132p24024421.html
Sent from the Mono - VB mailing list archive at Nabble.com.



More information about the Mono-vb mailing list