From 1682671cbfc58f05e789c0b3e3d156ce07139729 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 17 Jan 2007 14:15:50 +0000 Subject: [PATCH] *** empty log message *** --- ase/test/com/AwkForm.frm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ase/test/com/AwkForm.frm b/ase/test/com/AwkForm.frm index 3ed261fc..c9fdebca 100644 --- a/ase/test/com/AwkForm.frm +++ b/ase/test/com/AwkForm.frm @@ -184,6 +184,7 @@ Private Sub Execute_Click() Exit Sub End If Call Awk.AddBuiltinFunction("tan", 1, 1) + Call Awk.AddBuiltinFunction("sqr", 1, 1) Call Awk.AddBuiltinFunction("trim", 1, 1) 'Call Awk.DeleteBuiltinFunction("tan") @@ -411,12 +412,12 @@ End Function Function Awk_HandleBuiltinFunction(ByVal name As String, ByVal args As Variant) As Variant If name = "sin" Then - If TypeName(args(0)) = "Long" Or TypeName(args(0)) = "Double" Then - Awk_HandleBuiltinFunction = Sin(args(0)) - ElseIf TypeName(args(0)) = "String" Then - Awk_HandleBuiltinFunction = Sin(Val(args(0))) - ElseIf TypeName(args(0)) = "Null" Then + If IsNull(args(0)) Then Awk_HandleBuiltinFunction = Sin(0) + ElseIf IsNumeric(args(0)) Then + Awk_HandleBuiltinFunction = Sin(args(0)) + Else + Awk_HandleBuiltinFunction = Sin(Val(args(0))) End If ElseIf name = "cos" Then If TypeName(args(0)) = "Long" Or TypeName(args(0)) = "Double" Then @@ -434,6 +435,14 @@ Function Awk_HandleBuiltinFunction(ByVal name As String, ByVal args As Variant) ElseIf TypeName(args(0)) = "Null" Then Awk_HandleBuiltinFunction = Tan(0) End If + ElseIf name = "sqr" Then + If IsNull(args(0)) Then + Awk_HandleBuiltinFunction = Sqr(0) + ElseIf IsNumeric(args(0)) Then + Awk_HandleBuiltinFunction = Sqr(args(0)) + Else + Awk_HandleBuiltinFunction = Sqr(Val(args(0))) + End If ElseIf name = "trim" Then Awk_HandleBuiltinFunction = Trim(args(0)) End If