@@ -48,34 +48,36 @@ Namespace Microsoft.SmallVisualBasic.Engine
4848
4949 Private Sub DebugShowDialog(formName As String , argsArr As Primitive)
5050 Dim isLoaded = False
51- If WinForms.Form.GetIsLoaded(formName) Then
52- WinForms.Form.SetArgsArr(formName, argsArr)
53- isloaded = True
51+ Dim frmName As New Primitive(formName)
52+ If WinForms.Form.GetIsLoaded(frmName) Then
53+ WinForms.Form.SetArgsArr(frmName, argsArr)
54+ isLoaded = True
5455 Else
55- Stack.PushValue( "_" & CStr ( formName) .ToLower() & "_argsArr" , argsArr)
56+ Stack.PushValue( New Primitive( "_" & formName.ToLower() & "_argsArr" ) , argsArr)
5657 _currentRunner.RunForm(formName)
57- WinForms.Control.SetVisible(formName , False )
58+ WinForms.Control.SetVisible(frmName , False )
5859 End If
5960
60- WinForms.Form.ShowDialog(formName )
61+ WinForms.Form.ShowDialog(frmName )
6162 If isLoaded Then WinForms.Form.RaiseOnShown(formName)
6263 End Sub
6364
6465 Private Sub DebugShowForm(formName As String , argsArr As Primitive)
6566 If Not _currentRunner.Evaluating Then
66- If WinForms.Form.GetIsLoaded(formName) Then
67- WinForms.Forms.DoShowForm(formName, argsArr)
67+ Dim frmName As New Primitive(formName)
68+ If WinForms.Form.GetIsLoaded(frmName) Then
69+ WinForms.Forms.DoShowForm(frmName, argsArr)
6870 Else
69- Stack.PushValue( "_" & CStr ( formName) .ToLower() & "_argsArr" , argsArr)
71+ Stack.PushValue( New Primitive( "_" & formName.ToLower() & "_argsArr" ) , argsArr)
7072 _currentRunner.RunForm(formName)
7173 End If
7274 End If
7375 End Sub
7476
7577 Private Sub DebugShowChildForm(parentFormName As String , childFormName As String , argsArr As Primitive)
7678 If Not _currentRunner.Evaluating Then
77- Stack.PushValue( "_" & CStr ( childFormName) .ToLower() & "_argsArr" , argsArr)
78- Dim isLoaded = CBool (WinForms.Form.GetIsLoaded(childFormName))
79+ Stack.PushValue( New Primitive( "_" & childFormName.ToLower() & "_argsArr" ) , argsArr)
80+ Dim isLoaded = CBool (WinForms.Form.GetIsLoaded( New Primitive( childFormName) ))
7981 _currentRunner.RunForm(childFormName)
8082 WinForms.Form.SetOwner(childFormName, parentFormName)
8183 If isLoaded Then WinForms.Form.RaiseOnShown(childFormName)
@@ -106,7 +108,7 @@ Namespace Microsoft.SmallVisualBasic.Engine
106108
107109 If Not testMethods.Any Then Return
108110
109- Dim txtTest = WinForms.Form.AddTestTextBox(formName)
111+ Dim txtTest As New Primitive( WinForms.Form.AddTestTextBox(formName) )
110112 Dim errMsg = " doesn't return a value. Use a test function and return a text showing the result of the test."
111113 Dim n = 0
112114
@@ -121,17 +123,17 @@ Namespace Microsoft.SmallVisualBasic.Engine
121123 Dim msg As String = MethodCallExpression.EvaluateFunction(runner, subroutineCall)
122124
123125 If msg = "" Then
124- WinForms.TextBox.Append(txtTest, testName.Text)
125- WinForms.TextBox.Append(txtTest, errMsg)
126+ WinForms.TextBox.Append(txtTest, New Primitive( testName.Text) )
127+ WinForms.TextBox.Append(txtTest, New Primitive( errMsg) )
126128 Else
127- WinForms.TextBox.Append(txtTest, msg)
129+ WinForms.TextBox.Append(txtTest, New Primitive( msg) )
128130 n += 1
129131 End If
130132
131133 Catch ex As Exception
132- WinForms.TextBox.Append(txtTest, $"{testName} has caused the error: {ex.Message}." )
134+ WinForms.TextBox.Append(txtTest, New Primitive( $"{testName} has caused the error: {ex.Message}." ) )
133135 End Try
134- WinForms.TextBox.Append(txtTest, vbCrLf)
136+ WinForms.TextBox.Append(txtTest, New Primitive( vbCrLf) )
135137 Next
136138 result = n
137139 End Sub
0 commit comments