Author: rafim
Date: 2006-09-11 05:34:04 -0400 (Mon, 11 Sep 2006)
New Revision: 65217

Modified:
   
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.vb
   
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.vb
   trunk/mono-basic/vbruntime/TODO.txt
   trunk/mono-basic/vbruntime/VB.J2EE.build.bat
Log:
add TARGET_JVM to the source,  VB 1.1 now properly compiles into java and pass 
the java validator.

Modified: 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.vb
===================================================================
--- 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.vb
       2006-09-11 09:16:36 UTC (rev 65216)
+++ 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.vb
       2006-09-11 09:34:04 UTC (rev 65217)
@@ -58,6 +58,7 @@
                 End Try
             End Set
         End Property
+#If TARGET_JVM = False Then
         <DllImport("libc", EntryPoint:="stime", _
            SetLastError:=True, CharSet:=CharSet.Unicode, _
            ExactSpelling:=True, _
@@ -66,6 +67,7 @@
             ' Leave function empty - DllImport attribute forwards calls to 
stime to
             ' stime in libc.dll
         End Function
+#End If
 
         Public Property Today() As System.DateTime
             Get
@@ -78,9 +80,11 @@
                 Dim secondsTimeSpan As System.TimeSpan = 
NewDate.ToUniversalTime().Subtract(New DateTime(1970, 1, 1, 0, 0, 0))
                 Dim seconds As Integer = CType(secondsTimeSpan.TotalSeconds, 
Integer)
 
+#If TARGET_JVM = False Then
                 If (stime(seconds) = -1) Then
                     Throw New UnauthorizedAccessException("The caller is not 
the super-user.")
                 End If
+#End If
             End Set
         End Property
 
@@ -115,9 +119,11 @@
                 Dim secondsTimeSpan As TimeSpan = 
NewTime.ToUniversalTime().Subtract(New DateTime(1970, 1, 1, 0, 0, 0, 0))
                 Dim seconds As Integer = CType(secondsTimeSpan.TotalSeconds, 
Integer)
 
+#If TARGET_JVM = False Then
                 If (stime(seconds) = -1) Then
                     Throw New UnauthorizedAccessException("The caller is not 
the super-user.")
                 End If
+#End If
             End Set
         End Property
 

Modified: 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.vb
===================================================================
--- 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.vb
       2006-09-11 09:16:36 UTC (rev 65216)
+++ 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.vb
       2006-09-11 09:34:04 UTC (rev 65217)
@@ -31,8 +31,10 @@
 '
 Imports System
 Imports Microsoft.VisualBasic.CompilerServices
+#If TARGET_JVM = False Then 'Win32,Windows.Forms Not Supported by Grasshopper
 Imports Microsoft.Win32
 Imports System.Windows.Forms
+#End If
 
 Namespace Microsoft.VisualBasic
     Public Module Interaction
@@ -81,6 +83,9 @@
             Throw New NotImplementedException
         End Function
         Public Sub DeleteSetting(ByVal AppName As String, Optional ByVal 
Section As String = Nothing, Optional ByVal Key As String = Nothing)
+
+#If TARGET_JVM = False Then
+
             Dim rkey As RegistryKey
             rkey = Registry.CurrentUser
             If Section = Nothing Then
@@ -96,7 +101,9 @@
 
             'Closes the key and flushes it to disk if the contents have been 
modified.
             rkey.Close()
-
+#Else
+            Throw New NotImplementedException
+#End If
         End Sub
         Public Function Environ(ByVal Expression As Integer) As String
             Throw New NotImplementedException
@@ -106,6 +113,8 @@
         End Function
         Public Function GetAllSettings(ByVal AppName As String, ByVal Section 
As String) As String(,)
 
+#If TARGET_JVM = False Then
+
             If (AppName = "") Or (AppName Is Nothing) Then Throw New 
System.ArgumentException(" Argument 'AppName' is Nothing or empty.")
             If (Section = "") Or (Section Is Nothing) Then Throw New 
System.ArgumentException(" Argument 'Section' is Nothing or empty.")
 
@@ -136,17 +145,25 @@
                 res_setting(index, 1) = Interaction.GetSetting(AppName, 
Section, arr_str(index))
             Next
             Return res_setting
+
+#Else
+            Throw New NotImplementedException
+#End If
         End Function
         Public Function GetObject(Optional ByVal PathName As String = Nothing, 
Optional ByVal [Class] As String = Nothing) As Object
             'TODO: COM
             Throw New NotImplementedException
         End Function
         Public Function GetSetting(ByVal AppName As String, ByVal Section As 
String, ByVal Key As String, Optional ByVal [Default] As String = "") As String
+#If TARGET_JVM = False Then
             Dim rkey As RegistryKey
             rkey = Registry.CurrentUser
             rkey = rkey.OpenSubKey(AppName)
             rkey = rkey.OpenSubKey(Section)
             Return rkey.GetValue(Key, CObj([Default])).ToString
+#Else
+            Throw New NotImplementedException
+#End If
         End Function
         Public Function IIf(ByVal Expression As Boolean, ByVal TruePart As 
Object, ByVal FalsePart As Object) As Object
             If Expression Then
@@ -156,10 +173,14 @@
             End If
         End Function
         Public Function InputBox(ByVal Prompt As String, Optional ByVal Title 
As String = "", Optional ByVal DefaultResponse As String = "", Optional ByVal 
XPos As Integer = -1, Optional ByVal YPos As Integer = -1) As String
-            Dim form As Form
+#If TARGET_JVM = False Then
+            Dim form As form
 
             form.Text = Title
             Return ""
+#Else
+            Throw New NotImplementedException
+#End If
         End Function
         Public Function Partition(ByVal Number As Long, ByVal Start As Long, 
ByVal [Stop] As Long, ByVal Interval As Long) As String
 
@@ -219,6 +240,9 @@
 
         End Function
         Public Sub SaveSetting(ByVal AppName As String, ByVal Section As 
String, ByVal Key As String, ByVal Setting As String)
+
+#If TARGET_JVM = False Then
+
             Dim rkey As RegistryKey
             rkey = Registry.CurrentUser
             rkey = rkey.OpenSubKey(AppName)
@@ -226,6 +250,9 @@
             rkey.SetValue(Key, Setting)
             'Closes the key and flushes it to disk if the contents have been 
modified.
             rkey.Close()
+#Else
+            Throw New NotImplementedException
+#End If
         End Sub
         Public Function Shell(ByVal Pathname As String, Optional ByVal Style 
As Microsoft.VisualBasic.AppWinStyle = 
Microsoft.VisualBasic.AppWinStyle.MinimizedFocus, Optional ByVal Wait As 
Boolean = False, Optional ByVal Timeout As Integer = -1) As Integer
             'TODO: OS Specific

Modified: trunk/mono-basic/vbruntime/TODO.txt
===================================================================
--- trunk/mono-basic/vbruntime/TODO.txt 2006-09-11 09:16:36 UTC (rev 65216)
+++ trunk/mono-basic/vbruntime/TODO.txt 2006-09-11 09:34:04 UTC (rev 65217)
@@ -62,6 +62,7 @@
 Grasshopper Java TODO
 ======================
 * J2EE - Convert Microsoft.VisualBasic.dll into J2EE (Grasshopper 1.8) jar.
-* add java validator test to the build.
 * add TARGET_JVM defines to source code.
+* run the 3 test suites using the VB jar.
+* J2EE - Convert Microsoft.VisualBasic.dll into J2EE (Grasshopper 2.0) jar.
 

Modified: trunk/mono-basic/vbruntime/VB.J2EE.build.bat
===================================================================
--- trunk/mono-basic/vbruntime/VB.J2EE.build.bat        2006-09-11 09:16:36 UTC 
(rev 65216)
+++ trunk/mono-basic/vbruntime/VB.J2EE.build.bat        2006-09-11 09:34:04 UTC 
(rev 65217)
@@ -12,6 +12,7 @@
 
 SET VB_COMPILE_OPTIONS_J2EE=/define:TARGET_JVM=True
 call VB.build.bat 1 debug
+IF %ERRORLEVEL% NEQ 0 GOTO EXCEPTION
 
 rem ====================================
 rem set environment settings for running J2EE applications

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to