New and confused.
I can't find any examples of VB.NET UI scripts, so I'm using a VBScript one that seems to be working fine (thanks to whoever built the one I carved up <g>)
But I want to use a VB.NET Source template. It doesn't seem as if this should be a problem from what I can see. I _CAN_ mix and match these source languages, right?
OK... assuming I get a 'yes' to that, here's my first problem:
The UI runs fine, I click OK and am greeted by this:
------------------------------------------------------------------------
Exception Type:NullReferenceException
Source:DotNetScriptingEngine
Method: Void EngineExecuteCode(Zeus.IZeusCodeSegment, Zeus.IZeusContext)
Line 0 Column 0
Message:Object reference not set to an instance of an object.
-------------------------------------------------------------------------
If it was just on SOME actual line of code, I'd have a prayer of understanding what I've done to offend. But I just don't have a clue. This looked just fine in VS2003 (although, of course, I can't RUN it there).
FYI, the Output window has an amazingly brief amount of text considering how far it seems to have run. It only shows about seven lines of output and they are, of course, those which require no MyMeta content.
Here's the first 15 or so lines of code in case that helps.
------- Begin Code ---------------
Public Class GeneratedTemplate
Inherits DotNetScriptTemplate
Public Sub New(ByVal context As ZeusContext)
MyBase.New(context)
End Sub
'---------------------------------------------------
' Render() is where you want to write your logic
'---------------------------------------------------
Public Overrides Sub Render()
'
Dim oDB As IDatabase = MyMeta.Databases(Input.Item(\"cmbDatabase\"))
Dim oTable As ITable = oDB.Tables(Input.Item(\"lstTables\"))
'
' Now begin calling section writers
' Be consistent here; pass ITable to all of them, not a string
' Call Write ClassLevelInfo
Call ClassLevelInfo(oTable)
' Call Write MemVar Declarations
Call MemVarDeclarations(oTable)
----------------- End Code -----------------------------
the ClassLevelInfo routine looks like:
----------------- Begin Code -----------------------------
Private Sub ClassLevelInfo(ByVal poTable As ITable)
Dim strClassName As String = poTable.Alias
With output
.autoTabLn(\"<Serializable()> _\")
.autoTabLn(\"Public Class \" & strClassName & \"Base\")
.incTab()
.autoTabLn(\"Inherits BusinessBase\")
.autoTabLn(\"\")
End With
'
' [Note: the \"End Class\" is written by caller]
'
End Sub
----------------- End Code -----------------------------
There is NO '<%' at the top of the file. That seems correct to me for a VB.Net Template. My template properties include:
Type: Template
Mode: Pure
Template Scripting Engine: .Net Script
Template Language: VB.Net
Gui Scripting Engine: Microsoft Script
Gui Language: VBScript
Output Language: VB.Net
Thanks in advance,
Q Johnson[code][/code]
