[mono-vb] vbnc console menu question

Rolf Bjarne Kvinge rolflists at ya.com
Mon Apr 13 05:14:35 EDT 2009


Hi,

This is a bug in the compiler (crashing instead of reporting an error
message). 

You must do as Andy Hume said: change "Sub MenuMethod" to "Function
MenuMethod"

A bug has already been filed, so don't worry about that.

Rolf

> -----Original Message-----
> From: mono-vb-bounces at lists.ximian.com [mailto:mono-vb-
> bounces at lists.ximian.com] On Behalf Of Jude DaShiell
> Sent: domingo, 12 de abril de 2009 16:15
> To: mono-vb at lists.ximian.com
> Subject: [mono-vb] vbnc console menu question
> 
> Goal:
> Use menu subroutine in file menu.vb to show menu on screen then have
> tester.vb f
> ile that wraps around menu.vb print out collected response from
> menu.vb.  I trie
> d several things none of them successful but this last one was
> surprising.  I'm
> not using G.U.I. controls since they won't work in Linux command line
> environmen
> t and generate exceptions.  Compiler is vbnc.
> 
> Results:
> ' File: tester.vb
> Option Strict On
> Imports System
> 
> Module Tester
> Sub Main()
> Dim Answer As String = MenuMethod()
> MenuMethod( )
> Console.WriteLine("Caught: " + Answer)
> End Sub
> End Module
> 
> ' File: menu.vb
> Module Menu
> Sub MenuMethod()
> While(Menuvar<>"q")
> ' clear the console.
> Console.Clear()
>  	Console.WriteLine("")
> Console.WriteLine("iching Hexagram Generator - Program Menu")
> Console.WriteLine("")
> Console.WriteLine("Read (a)bout program")
> Console.WriteLine("randomly generate (c)omputer hexagram")
> Console.WriteLine("")
> Console.WriteLine("enter (r)ecorded hexagram")
> Console.WriteLine("")
> Console.WriteLine("(q)uit program")
> Console.WriteLine("")
> Console.WriteLine("")
> Console.WriteLine("your choice (a/c/r/q): ")
> Try
> Menuvar=Console.Read()
> Catch ex As Exception
> End Try
> End While
> Return Menuvar
> End Sub
> End Module
> 
> File: typescript
> Script started on Sun 12 Apr 2009 09:58:36 AM EDT
> dashielljt at gmpexpress:~/iching6$ vbnc tester.vb menu.vb
> 
> ** (/usr/lib/mono/2.0/vbnc.exe:2169): WARNING **: Symbol file
> /usr/lib/mono/2.0/vbnc.exe.mdb has incorrect version (expected 50.0,
> got 39)
> 
> ** (/usr/lib/mono/2.0/vbnc.exe:2169): WARNING **: Symbol file
> /usr/lib/mono/gac/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Micro
> soft.VisualBasic.dll.mdb has incorrect version (expected 50.0, got 39)
> Visual Basic.Net Compiler version 0.0.0.5904 (Mono 2.0 - r)
> Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.
> 
> 
> /home/dashielljt/iching6/<MyGenerator> (1,1) : Error VBNC99999:
> Unexpected error: There has been an internal error in the compiler
> caused by the line: (6,36)
>    at vbnc.Expression.ReclassifyToValueExpression () [0x00000]
>    at vbnc.VariableInitializer.ResolveCode (vbnc.ResolveInfo Info)
> [0x00000]
>    at vbnc.VariableDeclaration.ResolveCode (vbnc.ResolveInfo Info)
> [0x00000]
>    at vbnc.CodeBlock.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
>    at vbnc.MethodBaseDeclaration.ResolveCode (vbnc.ResolveInfo Info)
> [0x00000]
>    at vbnc.MethodDeclaration.ResolveCode (vbnc.ResolveInfo Info)
> [0x00000]
>    at vbnc.SubDeclaration.ResolveCode (vbnc.ResolveInfo Info) [0x00000]
>    at vbnc.Helper.ResolveCodeCollection (IEnumerable Collection,
> vbnc.ResolveInfo Info) [0x00000]
>    at vbnc.BaseObjects`1[vbnc.IMember].ResolveCode (vbnc.ResolveInfo
> Info) [0x00000]
>    at vbnc.TypeDeclaration.ResolveCode (vbnc.ResolveInfo Info)
> [0x00000]
>    at vbnc.AssemblyDeclaration.ResolveCode (vbnc.ResolveInfo Info)
> [0x00000]
>    at vbnc.Compiler.Compile_Resolve () [0x00000]
>    at vbnc.Compiler.Compile () [0x00000]
> Compilation took 00:00:03.0704570
> dashielljt at gmpexpress:~/iching6$ exit
> exit
> 
> Script done on Sun 12 Apr 2009 09:58:57 AM EDT
> 
> 
> _______________________________________________
> Mono-vb mailing list
> Mono-vb at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb



More information about the Mono-vb mailing list