qse/ase/test/com/AwkForm.frm

553 lines
15 KiB
Plaintext
Raw Normal View History

2006-12-10 16:13:50 +00:00
VERSION 5.00
Begin VB.Form AwkForm
2007-04-22 07:01:31 +00:00
BorderStyle = 1 'Fixed Single
2007-04-15 15:26:58 +00:00
Caption = "ASE.COM.AWK"
2007-04-21 12:40:44 +00:00
ClientHeight = 8100
2007-04-22 07:01:31 +00:00
ClientLeft = 45
ClientTop = 330
2007-04-21 12:40:44 +00:00
ClientWidth = 12900
2006-12-10 16:13:50 +00:00
LinkTopic = "AwkForm"
2007-04-21 12:40:44 +00:00
MaxButton = 0 'False
2007-04-22 07:01:31 +00:00
MinButton = 0 'False
2007-04-21 12:40:44 +00:00
ScaleHeight = 8100
ScaleWidth = 12900
2006-12-10 16:13:50 +00:00
StartUpPosition = 3 'Windows Default
2007-04-21 12:40:44 +00:00
Begin VB.CommandButton btnClearAll
Caption = "Clear All"
Height = 375
Left = 240
TabIndex = 14
Top = 4560
Width = 2295
End
Begin VB.CommandButton btnAddArgument
Caption = "Add"
Height = 375
Left = 1920
TabIndex = 12
Top = 4080
Width = 615
End
Begin VB.TextBox txtArgument
Height = 375
Left = 240
TabIndex = 11
Top = 4080
Width = 1575
End
Begin VB.ListBox lstArguments
Height = 2595
Left = 240
TabIndex = 10
Top = 1320
Width = 2295
End
2007-01-10 14:33:51 +00:00
Begin VB.ComboBox EntryPoint
2007-01-07 07:30:40 +00:00
Height = 315
ItemData = "AwkForm.frx":0000
2007-04-21 12:40:44 +00:00
Left = 240
2007-01-10 14:33:51 +00:00
List = "AwkForm.frx":0007
2007-01-07 07:30:40 +00:00
TabIndex = 9
2007-04-21 12:40:44 +00:00
Top = 480
Width = 2295
2007-01-07 07:30:40 +00:00
End
2006-12-10 16:13:50 +00:00
Begin VB.TextBox ConsoleIn
BeginProperty Font
Name = "Courier New"
2006-12-15 06:47:09 +00:00
Size = 9
2006-12-10 16:13:50 +00:00
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
2007-04-21 12:40:44 +00:00
Height = 3735
Left = 2760
2006-12-10 16:13:50 +00:00
MultiLine = -1 'True
2007-01-07 07:30:40 +00:00
ScrollBars = 3 'Both
TabIndex = 2
2007-04-21 12:40:44 +00:00
Top = 4320
2006-12-11 08:44:52 +00:00
Width = 5055
2006-12-10 16:13:50 +00:00
End
Begin VB.TextBox SourceIn
BeginProperty Font
Name = "Courier New"
2006-12-15 06:47:09 +00:00
Size = 9
2006-12-10 16:13:50 +00:00
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
2007-04-21 12:40:44 +00:00
Height = 3615
Left = 2760
2006-12-10 16:13:50 +00:00
MultiLine = -1 'True
2007-01-07 07:30:40 +00:00
ScrollBars = 3 'Both
TabIndex = 0
2007-04-21 12:40:44 +00:00
Top = 360
2006-12-11 08:44:52 +00:00
Width = 5055
2006-12-10 16:13:50 +00:00
End
Begin VB.TextBox SourceOut
BeginProperty Font
Name = "Courier New"
2006-12-15 06:47:09 +00:00
Size = 9
2006-12-10 16:13:50 +00:00
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
2007-04-21 12:40:44 +00:00
Height = 3615
Left = 7920
2007-01-07 07:30:40 +00:00
Locked = -1 'True
2006-12-10 16:13:50 +00:00
MultiLine = -1 'True
2007-01-07 07:30:40 +00:00
ScrollBars = 3 'Both
TabIndex = 1
2007-04-21 12:40:44 +00:00
Top = 360
2006-12-11 08:44:52 +00:00
Width = 4935
2006-12-10 16:13:50 +00:00
End
2007-04-21 12:40:44 +00:00
Begin VB.CommandButton btnExecute
2006-12-10 16:13:50 +00:00
Caption = "Execute"
Height = 375
2007-04-21 12:40:44 +00:00
Left = 1440
2007-01-07 07:30:40 +00:00
TabIndex = 5
2007-04-21 12:40:44 +00:00
Top = 7680
2006-12-10 16:13:50 +00:00
Width = 1215
End
Begin VB.TextBox ConsoleOut
BeginProperty Font
Name = "Courier New"
2006-12-15 06:47:09 +00:00
Size = 9
2006-12-10 16:13:50 +00:00
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
2007-04-21 12:40:44 +00:00
Height = 3735
Left = 7920
2006-12-10 16:13:50 +00:00
MultiLine = -1 'True
2007-01-07 07:30:40 +00:00
ScrollBars = 3 'Both
TabIndex = 3
2007-04-21 12:40:44 +00:00
Top = 4320
2006-12-11 08:44:52 +00:00
Width = 4935
2006-12-10 16:13:50 +00:00
End
2007-04-21 12:40:44 +00:00
Begin VB.Frame Frame1
Caption = "Arguments"
Height = 4335
2007-01-07 07:30:40 +00:00
Left = 120
2007-04-21 12:40:44 +00:00
TabIndex = 13
Top = 1080
Width = 2535
Begin VB.CheckBox chkPassToEntryPoint
Caption = "Pass To Entry Point"
Height = 255
Left = 360
TabIndex = 16
Top = 3960
Width = 1815
End
End
Begin VB.Frame Frame2
Caption = "Entry Point"
Height = 855
Left = 120
TabIndex = 15
2007-01-07 07:30:40 +00:00
Top = 120
2007-04-21 12:40:44 +00:00
Width = 2535
2007-01-07 07:30:40 +00:00
End
Begin VB.Label Label4
Caption = "Console Out"
Height = 255
2007-04-21 12:40:44 +00:00
Left = 7920
2007-01-07 07:30:40 +00:00
TabIndex = 8
2007-04-21 12:40:44 +00:00
Top = 4080
2007-01-07 07:30:40 +00:00
Width = 3735
End
Begin VB.Label Label3
Caption = "Console In"
Height = 255
2007-04-21 12:40:44 +00:00
Left = 2760
2007-01-07 07:30:40 +00:00
TabIndex = 7
2007-04-21 12:40:44 +00:00
Top = 4080
2007-01-07 07:30:40 +00:00
Width = 3735
End
Begin VB.Label Label2
2007-01-16 14:20:43 +00:00
Caption = "Source Out"
2007-01-07 07:30:40 +00:00
Height = 255
2007-04-21 12:40:44 +00:00
Left = 7920
2007-01-07 07:30:40 +00:00
TabIndex = 6
2007-04-21 12:40:44 +00:00
Top = 120
2007-01-07 07:30:40 +00:00
Width = 3735
End
Begin VB.Label Label1
2007-01-16 14:20:43 +00:00
Caption = "Source In"
2007-01-07 07:30:40 +00:00
Height = 255
2007-04-21 12:40:44 +00:00
Left = 2760
2007-01-07 07:30:40 +00:00
TabIndex = 4
2007-04-21 12:40:44 +00:00
Top = 120
2007-01-07 07:30:40 +00:00
Width = 2415
End
2006-12-10 16:13:50 +00:00
End
Attribute VB_Name = "AwkForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
2007-04-21 12:40:44 +00:00
Option Base 0
2006-12-14 07:55:52 +00:00
Dim source_first As Boolean
2007-04-22 07:49:38 +00:00
Public WithEvents Awk As ASECOM.Awk
2006-12-11 14:58:25 +00:00
Attribute Awk.VB_VarHelpID = -1
2006-12-11 06:29:19 +00:00
2007-04-21 12:40:44 +00:00
Private Sub btnAddArgument_Click()
Dim arg As String
arg = txtArgument.Text
If Len(arg) > 0 Then
lstArguments.AddItem (arg)
txtArgument.Text = ""
txtArgument.SetFocus
End If
End Sub
Private Sub btnClearAll_Click()
lstArguments.Clear
End Sub
Private Sub btnExecute_Click()
2006-12-14 07:55:52 +00:00
source_first = True
2006-12-10 16:13:50 +00:00
ConsoleOut.Text = ""
SourceOut.Text = ""
2007-04-22 07:49:38 +00:00
Set Awk = New ASECOM.Awk
2006-12-11 14:58:25 +00:00
2007-01-05 06:29:46 +00:00
Awk.ExplicitVariable = True
2007-01-07 07:30:40 +00:00
Awk.ImplicitVariable = True
2007-01-05 13:39:38 +00:00
Awk.UseCrlf = True
Awk.IdivOperator = True
2007-01-07 07:30:40 +00:00
Awk.ShiftOperators = True
2007-01-05 06:29:46 +00:00
2007-01-07 07:30:40 +00:00
Awk.MaxDepthForBlockParse = 20
Awk.MaxDepthForBlockRun = 30
2007-01-10 14:33:51 +00:00
Awk.MaxDepthForExprParse = 20
Awk.MaxDepthForExprRun = 30
2007-01-07 07:30:40 +00:00
'Awk.MaxDepthForRexBuild = 10
'Awk.MaxDepthForRexMatch = 10
2007-01-06 15:45:50 +00:00
2007-01-16 06:09:07 +00:00
Awk.UseLongLong = False
2007-01-11 03:56:02 +00:00
Awk.Debug = True
2007-04-15 14:25:35 +00:00
If Not Awk.AddFunction("sin", 1, 1) Then
2007-01-16 14:20:43 +00:00
MsgBox "Cannot add builtin function - " + Awk.ErrorMessage
Exit Sub
End If
2007-04-15 14:25:35 +00:00
If Not Awk.AddFunction("cos", 1, 1) Then
2007-01-17 03:45:59 +00:00
MsgBox "Cannot add builtin function - " + Awk.ErrorMessage
Exit Sub
End If
2007-04-15 13:15:35 +00:00
Call Awk.AddFunction("tan", 1, 1)
Call Awk.AddFunction("sqrt", 1, 1)
Call Awk.AddFunction("trim", 1, 1)
'Call Awk.DeleteFunction("tan")
2007-01-16 14:20:43 +00:00
2007-04-15 14:25:35 +00:00
If Not Awk.Parse() Then
2007-01-07 07:30:40 +00:00
MsgBox "PARSE ERROR [" + Str(Awk.ErrorLine) + "]" + Awk.ErrorMessage
2007-01-03 09:51:53 +00:00
Else
2007-04-21 12:40:44 +00:00
Dim n As Boolean
2007-01-10 14:33:51 +00:00
Awk.EntryPoint = Trim(EntryPoint.Text)
2007-04-21 12:40:44 +00:00
If lstArguments.ListCount = 0 Then
n = Awk.Run(Null)
Else
ReDim Args(lstArguments.ListCount - 1) As String
Dim i As Integer
Awk.ArgumentsToEntryPoint = chkPassToEntryPoint.value
For i = 0 To lstArguments.ListCount - 1
Args(i) = lstArguments.List(i)
Next i
n = Awk.Run(Args)
End If
If Not n Then
2007-01-07 07:30:40 +00:00
MsgBox "RUN ERROR [" + Str(Awk.ErrorLine) + "]" + Awk.ErrorMessage
2007-01-03 09:51:53 +00:00
End If
2006-12-11 08:44:52 +00:00
End If
2007-01-03 09:51:53 +00:00
2006-12-11 14:58:25 +00:00
Set Awk = Nothing
2006-12-10 16:13:50 +00:00
End Sub
2007-04-22 07:49:38 +00:00
Function Awk_OpenSource(ByVal mode As ASECOM.AwkSourceMode) As Long
2006-12-11 14:58:25 +00:00
Awk_OpenSource = 1
2006-12-10 16:13:50 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function Awk_CloseSource(ByVal mode As ASECOM.AwkSourceMode) As Long
2006-12-11 14:58:25 +00:00
Awk_CloseSource = 0
2006-12-10 16:13:50 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function Awk_ReadSource(ByVal buf As ASECOM.Buffer) As Long
2006-12-14 07:55:52 +00:00
If source_first Then
2006-12-10 16:13:50 +00:00
buf.value = SourceIn.Text
2006-12-11 14:58:25 +00:00
Awk_ReadSource = Len(buf.value)
2006-12-14 07:55:52 +00:00
source_first = False
2006-12-10 16:13:50 +00:00
Else
2006-12-11 14:58:25 +00:00
Awk_ReadSource = 0
2006-12-10 16:13:50 +00:00
End If
End Function
2007-04-22 07:49:38 +00:00
Function Awk_WriteSource(ByVal buf As ASECOM.Buffer) As Long
2007-01-03 09:51:53 +00:00
Dim value As String
Dim l As Integer
2006-12-10 16:13:50 +00:00
value = buf.value
2007-01-03 09:51:53 +00:00
l = Len(value)
SourceOut.Text = SourceOut.Text + value
Awk_WriteSource = Len(value)
2006-12-10 16:13:50 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function Awk_OpenExtio(ByVal extio As ASECOM.AwkExtio) As Long
2006-12-11 14:58:25 +00:00
Awk_OpenExtio = -1
Select Case extio.Type
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_CONSOLE
If extio.mode = ASECOM.AWK_EXTIO_CONSOLE_READ Then
2006-12-14 07:55:52 +00:00
extio.Handle = New AwkExtioConsole
With extio.Handle
2006-12-15 06:47:09 +00:00
.EOF = False
2006-12-14 07:55:52 +00:00
End With
2006-12-11 14:58:25 +00:00
Awk_OpenExtio = 1
2007-04-22 07:49:38 +00:00
ElseIf extio.mode = ASECOM.AWK_EXTIO_CONSOLE_WRITE Then
2006-12-14 07:55:52 +00:00
extio.Handle = New AwkExtioConsole
With extio.Handle
2006-12-15 06:47:09 +00:00
.EOF = False
2006-12-14 07:55:52 +00:00
End With
2006-12-11 14:58:25 +00:00
Awk_OpenExtio = 1
End If
2006-12-15 06:47:09 +00:00
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_FILE
If extio.mode = ASECOM.AWK_EXTIO_FILE_READ Then
2006-12-15 06:47:09 +00:00
extio.Handle = FreeFile
On Error GoTo ErrorTrap
2007-01-14 15:08:01 +00:00
Open extio.name For Input As #extio.Handle
2006-12-15 06:47:09 +00:00
On Error GoTo 0
Awk_OpenExtio = 1
2007-04-22 07:49:38 +00:00
ElseIf extio.mode = ASECOM.AWK_EXTIO_FILE_WRITE Then
2006-12-15 06:47:09 +00:00
extio.Handle = FreeFile
On Error GoTo ErrorTrap
2007-01-14 15:08:01 +00:00
Open extio.name For Output As #extio.Handle
2006-12-15 06:47:09 +00:00
On Error GoTo 0
Awk_OpenExtio = 1
2007-04-22 07:49:38 +00:00
ElseIf extio.mode = ASECOM.AWK_EXTIO_FILE_APPEND Then
2006-12-15 06:47:09 +00:00
extio.Handle = FreeFile
On Error GoTo ErrorTrap
2007-01-14 15:08:01 +00:00
Open extio.name For Append As #extio.Handle
2006-12-15 06:47:09 +00:00
On Error GoTo 0
Awk_OpenExtio = 1
End If
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_PIPE
2007-01-17 03:45:59 +00:00
Awk_OpenExtio = -1
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_COPROC
2007-01-17 03:45:59 +00:00
Awk_OpenExtio = -1
2006-12-11 14:58:25 +00:00
End Select
2006-12-11 08:44:52 +00:00
2006-12-15 06:47:09 +00:00
Exit Function
ErrorTrap:
Exit Function
2006-12-10 16:13:50 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function Awk_CloseExtio(ByVal extio As ASECOM.AwkExtio) As Long
2006-12-11 14:58:25 +00:00
Awk_CloseExtio = -1
Select Case extio.Type
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_CONSOLE
If extio.mode = ASECOM.AWK_EXTIO_CONSOLE_READ Or _
extio.mode = ASECOM.AWK_EXTIO_CONSOLE_WRITE Then
2006-12-14 07:55:52 +00:00
extio.Handle = Nothing
2006-12-11 14:58:25 +00:00
Awk_CloseExtio = 0
End If
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_FILE
If extio.mode = ASECOM.AWK_EXTIO_FILE_READ Or _
extio.mode = ASECOM.AWK_EXTIO_FILE_WRITE Or _
extio.mode = ASECOM.AWK_EXTIO_FILE_APPEND Then
2006-12-15 06:47:09 +00:00
Close #extio.Handle
Awk_CloseExtio = 0
End If
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_PIPE
2007-01-17 03:45:59 +00:00
Awk_CloseExtio = -1
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_COPROC
2007-01-17 03:45:59 +00:00
Awk_CloseExtio = -1
2006-12-11 14:58:25 +00:00
End Select
2006-12-10 16:13:50 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function Awk_ReadExtio(ByVal extio As ASECOM.AwkExtio, ByVal buf As ASECOM.Buffer) As Long
2006-12-14 07:55:52 +00:00
Awk_ReadExtio = -1
Select Case extio.Type
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_CONSOLE
If extio.mode = ASECOM.AWK_EXTIO_CONSOLE_READ Then
2006-12-15 06:47:09 +00:00
Awk_ReadExtio = ReadExtioConsole(extio, buf)
End If
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_FILE
If extio.mode = ASECOM.AWK_EXTIO_FILE_READ Then
2006-12-15 06:47:09 +00:00
Awk_ReadExtio = ReadExtioFile(extio, buf)
End If
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_PIPE
2007-01-17 03:45:59 +00:00
Awk_ReadExtio = -1
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_COPROC
2007-01-17 03:45:59 +00:00
Awk_ReadExtio = -1
2006-12-15 06:47:09 +00:00
End Select
End Function
2007-04-22 07:49:38 +00:00
Function Awk_WriteExtio(ByVal extio As ASECOM.AwkExtio, ByVal buf As ASECOM.Buffer) As Long
2006-12-15 06:47:09 +00:00
Awk_WriteExtio = -1
Select Case extio.Type
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_CONSOLE
If extio.mode = ASECOM.AWK_EXTIO_CONSOLE_WRITE Then
2006-12-15 06:47:09 +00:00
Awk_WriteExtio = WriteExtioConsole(extio, buf)
2006-12-14 07:55:52 +00:00
End If
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_FILE
If extio.mode = ASECOM.AWK_EXTIO_FILE_WRITE Or _
extio.mode = ASECOM.AWK_EXTIO_FILE_APPEND Then
2006-12-15 06:47:09 +00:00
Awk_WriteExtio = WriteExtioFile(extio, buf)
End If
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_PIPE
2007-01-17 03:45:59 +00:00
Awk_WriteExtio = -1
2007-04-22 07:49:38 +00:00
Case ASECOM.AWK_EXTIO_COPROC
2007-01-17 03:45:59 +00:00
Awk_WriteExtio = -1
2006-12-14 07:55:52 +00:00
End Select
End Function
2007-04-22 07:49:38 +00:00
Function ReadExtioConsole(ByVal extio As ASECOM.AwkExtio, ByVal buf As ASECOM.Buffer) As Long
2007-01-03 09:51:53 +00:00
Dim value As String
2006-12-14 07:55:52 +00:00
2006-12-15 06:47:09 +00:00
If Not extio.Handle.EOF Then
2006-12-11 06:29:19 +00:00
value = ConsoleIn.Text
2006-12-15 06:47:09 +00:00
extio.Handle.EOF = True
2007-01-03 09:51:53 +00:00
buf.value = value
ReadExtioConsole = Len(value)
2006-12-11 06:29:19 +00:00
Else
2006-12-15 06:47:09 +00:00
ReadExtioConsole = 0
2006-12-11 06:29:19 +00:00
End If
2006-12-10 16:13:50 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function ReadExtioFile(ByVal extio As ASECOM.AwkExtio, ByVal buf As ASECOM.Buffer) As Long
2006-12-15 06:47:09 +00:00
Dim value As String
2006-12-10 16:13:50 +00:00
2006-12-15 06:47:09 +00:00
If EOF(extio.Handle) Then
ReadExtioFile = 0
Exit Function
End If
On Error GoTo ErrorTrap
Line Input #extio.Handle, value
On Error GoTo 0
value = value + vbCrLf
buf.value = value
ReadExtioFile = Len(buf.value)
Exit Function
ErrorTrap:
ReadExtioFile = -1
Exit Function
2006-12-14 07:55:52 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function WriteExtioConsole(ByVal extio As ASECOM.AwkExtio, ByVal buf As ASECOM.Buffer) As Long
2006-12-15 06:47:09 +00:00
Dim value As String
2006-12-11 08:44:52 +00:00
2006-12-10 16:13:50 +00:00
value = buf.value
2007-01-03 09:51:53 +00:00
ConsoleOut.Text = ConsoleOut.Text + value
WriteExtioConsole = Len(value)
2006-12-10 16:13:50 +00:00
End Function
2007-04-22 07:49:38 +00:00
Function WriteExtioFile(ByVal extio As ASECOM.AwkExtio, ByVal buf As ASECOM.Buffer) As Long
2006-12-15 06:47:09 +00:00
Dim value As String
WriteExtioFile = -1
value = buf.value
On Error GoTo ErrorTrap
Print #extio.Handle, value;
On Error GoTo 0
WriteExtioFile = Len(value)
Exit Function
ErrorTrap:
Exit Function
End Function
2007-04-21 12:40:44 +00:00
Function Awk_HandleBuiltinFunction(ByVal name As String, ByVal Args As Variant) As Variant
2007-01-14 15:08:01 +00:00
2007-01-16 06:09:07 +00:00
If name = "sin" Then
2007-04-21 12:40:44 +00:00
If IsNull(Args(0)) Then
2007-01-17 14:15:50 +00:00
Awk_HandleBuiltinFunction = Sin(0)
2007-04-21 12:40:44 +00:00
ElseIf IsNumeric(Args(0)) Then
Awk_HandleBuiltinFunction = Sin(Args(0))
2007-01-17 14:15:50 +00:00
Else
2007-04-21 12:40:44 +00:00
Awk_HandleBuiltinFunction = Sin(Val(Args(0)))
2007-01-17 14:09:49 +00:00
End If
2007-01-16 06:09:07 +00:00
ElseIf name = "cos" Then
2007-04-21 12:40:44 +00:00
If TypeName(Args(0)) = "Long" Or TypeName(Args(0)) = "Double" Then
Awk_HandleBuiltinFunction = Cos(Args(0))
ElseIf TypeName(Args(0)) = "String" Then
Awk_HandleBuiltinFunction = Cos(Val(Args(0)))
ElseIf TypeName(Args(0)) = "Null" Then
2007-01-17 14:09:49 +00:00
Awk_HandleBuiltinFunction = Cos(0)
End If
2007-01-16 06:09:07 +00:00
ElseIf name = "tan" Then
2007-04-21 12:40:44 +00:00
If TypeName(Args(0)) = "Long" Or TypeName(Args(0)) = "Double" Then
Awk_HandleBuiltinFunction = Tan(Args(0))
ElseIf TypeName(Args(0)) = "String" Then
Awk_HandleBuiltinFunction = Tan(Val(Args(0)))
ElseIf TypeName(Args(0)) = "Null" Then
2007-01-17 14:09:49 +00:00
Awk_HandleBuiltinFunction = Tan(0)
End If
2007-04-14 15:30:14 +00:00
ElseIf name = "sqrt" Then
2007-04-21 12:40:44 +00:00
If IsNull(Args(0)) Then
2007-01-17 14:15:50 +00:00
Awk_HandleBuiltinFunction = Sqr(0)
2007-04-21 12:40:44 +00:00
ElseIf IsNumeric(Args(0)) Then
Awk_HandleBuiltinFunction = Sqr(Args(0))
2007-01-17 14:15:50 +00:00
Else
2007-04-21 12:40:44 +00:00
Awk_HandleBuiltinFunction = Sqr(Val(Args(0)))
2007-01-17 14:15:50 +00:00
End If
2007-01-16 14:20:43 +00:00
ElseIf name = "trim" Then
2007-04-21 12:40:44 +00:00
Awk_HandleBuiltinFunction = Trim(Args(0))
2007-01-16 06:09:07 +00:00
End If
'Dim i As Integer
'Dim xxx As String
2007-01-14 15:08:01 +00:00
2007-01-16 06:09:07 +00:00
'MsgBox name
2007-01-14 15:08:01 +00:00
2007-01-16 06:09:07 +00:00
'For i = LBound(args) To UBound(args)
' xxx = xxx & "," & args(i)
'Next i
2007-01-14 15:08:01 +00:00
2007-01-16 06:09:07 +00:00
'MsgBox xxx
2007-01-14 15:08:01 +00:00
End Function
2007-04-21 12:40:44 +00:00
2006-12-10 16:13:50 +00:00
Private Sub Form_Load()
2007-01-07 07:30:40 +00:00
SourceIn.Text = ""
2006-12-10 16:13:50 +00:00
SourceOut.Text = ""
ConsoleIn.Text = ""
ConsoleOut.Text = ""
End Sub