*** empty log message ***

This commit is contained in:
hyung-hwan 2007-01-05 06:29:46 +00:00
parent b8729c918a
commit d26963d3d3
4 changed files with 29 additions and 47 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.cpp,v 1.10 2007-01-03 09:51:52 bacon Exp $ * $Id: Awk.cpp,v 1.11 2007-01-05 06:29:46 bacon Exp $
*/ */
#include "stdafx.h" #include "stdafx.h"
@ -547,18 +547,6 @@ HRESULT CAwk::Run (int* ret)
return S_OK; return S_OK;
} }
STDMETHODIMP CAwk::get_Option (int *pVal)
{
*pVal = option;
return S_OK;
}
STDMETHODIMP CAwk::put_Option (int newVal)
{
newVal = option;
return S_OK;
}
STDMETHODIMP CAwk::get_ErrorCode(int *pVal) STDMETHODIMP CAwk::get_ErrorCode(int *pVal)
{ {
*pVal = errnum; *pVal = errnum;
@ -589,7 +577,7 @@ STDMETHODIMP CAwk::get_ImplicitVariable(BOOL *pVal)
STDMETHODIMP CAwk::put_ImplicitVariable(BOOL newVal) STDMETHODIMP CAwk::put_ImplicitVariable(BOOL newVal)
{ {
if (newVal) option = option | ASE_AWK_IMPLICIT; if (newVal) option = option | ASE_AWK_IMPLICIT;
else option = option | ~ASE_AWK_IMPLICIT; else option = option & ~ASE_AWK_IMPLICIT;
if (handle != NULL) ase_awk_setopt (handle, option); if (handle != NULL) ase_awk_setopt (handle, option);
return S_OK; return S_OK;
} }
@ -604,7 +592,7 @@ STDMETHODIMP CAwk::get_ExplicitVariable(BOOL *pVal)
STDMETHODIMP CAwk::put_ExplicitVariable(BOOL newVal) STDMETHODIMP CAwk::put_ExplicitVariable(BOOL newVal)
{ {
if (newVal) option = option | ASE_AWK_EXPLICIT; if (newVal) option = option | ASE_AWK_EXPLICIT;
else option = option | ~ASE_AWK_EXPLICIT; else option = option & ~ASE_AWK_EXPLICIT;
if (handle != NULL) ase_awk_setopt (handle, option); if (handle != NULL) ase_awk_setopt (handle, option);
return S_OK; return S_OK;
} }
@ -619,7 +607,7 @@ STDMETHODIMP CAwk::get_UniqueFunction(BOOL *pVal)
STDMETHODIMP CAwk::put_UniqueFunction(BOOL newVal) STDMETHODIMP CAwk::put_UniqueFunction(BOOL newVal)
{ {
if (newVal) option = option | ASE_AWK_UNIQUEFN; if (newVal) option = option | ASE_AWK_UNIQUEFN;
else option = option | ~ASE_AWK_UNIQUEFN; else option = option & ~ASE_AWK_UNIQUEFN;
if (handle != NULL) ase_awk_setopt (handle, option); if (handle != NULL) ase_awk_setopt (handle, option);
return S_OK; return S_OK;
} }
@ -634,7 +622,7 @@ STDMETHODIMP CAwk::get_VariableShading(BOOL *pVal)
STDMETHODIMP CAwk::put_VariableShading(BOOL newVal) STDMETHODIMP CAwk::put_VariableShading(BOOL newVal)
{ {
if (newVal) option = option | ASE_AWK_SHADING; if (newVal) option = option | ASE_AWK_SHADING;
else option = option | ~ASE_AWK_SHADING; else option = option & ~ASE_AWK_SHADING;
if (handle != NULL) ase_awk_setopt (handle, option); if (handle != NULL) ase_awk_setopt (handle, option);
return S_OK; return S_OK;
} }
@ -649,7 +637,7 @@ STDMETHODIMP CAwk::get_ShiftOperators(BOOL *pVal)
STDMETHODIMP CAwk::put_ShiftOperators(BOOL newVal) STDMETHODIMP CAwk::put_ShiftOperators(BOOL newVal)
{ {
if (newVal) option = option | ASE_AWK_SHIFT; if (newVal) option = option | ASE_AWK_SHIFT;
else option = option | ~ASE_AWK_SHIFT; else option = option & ~ASE_AWK_SHIFT;
if (handle != NULL) ase_awk_setopt (handle, option); if (handle != NULL) ase_awk_setopt (handle, option);
return S_OK; return S_OK;
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: Awk.h,v 1.5 2007-01-03 09:51:52 bacon Exp $ * $Id: Awk.h,v 1.6 2007-01-05 06:29:46 bacon Exp $
*/ */
#ifndef _ASE_COM_AWK_H_ #ifndef _ASE_COM_AWK_H_
@ -81,8 +81,6 @@ public:
STDMETHOD(get_ErrorMessage)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(get_ErrorMessage)(/*[out, retval]*/ BSTR *pVal);
STDMETHOD(get_ErrorLine)(/*[out, retval]*/ int *pVal); STDMETHOD(get_ErrorLine)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_ErrorCode)(/*[out, retval]*/ int *pVal); STDMETHOD(get_ErrorCode)(/*[out, retval]*/ int *pVal);
STDMETHOD(get_Option)(/*[out, retval]*/ int *pVal);
STDMETHOD(put_Option)(/*[in]*/ int newVal);
HRESULT __stdcall Parse (int* ret); HRESULT __stdcall Parse (int* ret);
HRESULT __stdcall Run (int* ret); HRESULT __stdcall Run (int* ret);
}; };

View File

@ -1,5 +1,5 @@
/* /*
* $Id: ase.idl,v 1.4 2007-01-03 09:51:52 bacon Exp $ * $Id: ase.idl,v 1.5 2007-01-05 06:29:46 bacon Exp $
*/ */
import "oaidl.idl"; import "oaidl.idl";
@ -21,24 +21,25 @@ interface IAwk : IDispatch
[id(2), helpstring("method Run")] [id(2), helpstring("method Run")]
HRESULT Run([out, retval] int* ret); HRESULT Run([out, retval] int* ret);
[propget, id(3), helpstring("property Option")] [propget, id(3), helpstring("property ErrorCode")]
HRESULT Option([out, retval] int *pVal); HRESULT ErrorCode([out, retval] int *pVal);
[propput, id(3), helpstring("property Option")] [propget, id(4), helpstring("property ErrorLine")]
HRESULT Option([in] int newVal); HRESULT ErrorLine([out, retval] int *pVal);
[propget, id(4), helpstring("property ErrorCode")] HRESULT ErrorCode([out, retval] int *pVal);
[propget, id(5), helpstring("property ErrorLine")] HRESULT ErrorLine([out, retval] int *pVal); [propget, id(5), helpstring("property ErrorMessage")]
[propget, id(6), helpstring("property ErrorMessage")] HRESULT ErrorMessage([out, retval] BSTR *pVal); HRESULT ErrorMessage([out, retval] BSTR *pVal);
[propget, id(7), helpstring("property ImplicitVariable")] HRESULT ImplicitVariable([out, retval] BOOL *pVal);
[propput, id(7), helpstring("property ImplicitVariable")] HRESULT ImplicitVariable([in] BOOL newVal); [propget, id(6), helpstring("property ImplicitVariable")] HRESULT ImplicitVariable([out, retval] BOOL *pVal);
[propget, id(8), helpstring("property ExplicitVariable")] HRESULT ExplicitVariable([out, retval] BOOL *pVal); [propput, id(6), helpstring("property ImplicitVariable")] HRESULT ImplicitVariable([in] BOOL newVal);
[propput, id(8), helpstring("property ExplicitVariable")] HRESULT ExplicitVariable([in] BOOL newVal); [propget, id(7), helpstring("property ExplicitVariable")] HRESULT ExplicitVariable([out, retval] BOOL *pVal);
[propget, id(9), helpstring("property UniqueFunction")] HRESULT UniqueFunction([out, retval] BOOL *pVal); [propput, id(7), helpstring("property ExplicitVariable")] HRESULT ExplicitVariable([in] BOOL newVal);
[propput, id(9), helpstring("property UniqueFunction")] HRESULT UniqueFunction([in] BOOL newVal); [propget, id(8), helpstring("property UniqueFunction")] HRESULT UniqueFunction([out, retval] BOOL *pVal);
[propget, id(10), helpstring("property VariableShading")] HRESULT VariableShading([out, retval] BOOL *pVal); [propput, id(8), helpstring("property UniqueFunction")] HRESULT UniqueFunction([in] BOOL newVal);
[propput, id(10), helpstring("property VariableShading")] HRESULT VariableShading([in] BOOL newVal); [propget, id(9), helpstring("property VariableShading")] HRESULT VariableShading([out, retval] BOOL *pVal);
[propget, id(11), helpstring("property ShiftOperators")] HRESULT ShiftOperators([out, retval] BOOL *pVal); [propput, id(9), helpstring("property VariableShading")] HRESULT VariableShading([in] BOOL newVal);
[propput, id(11), helpstring("property ShiftOperators")] HRESULT ShiftOperators([in] BOOL newVal); [propget, id(10), helpstring("property ShiftOperators")] HRESULT ShiftOperators([out, retval] BOOL *pVal);
[propput, id(10), helpstring("property ShiftOperators")] HRESULT ShiftOperators([in] BOOL newVal);
}; };
/* ASELib */ /* ASELib */

View File

@ -105,6 +105,9 @@ Private Sub Execute_Click()
Set Awk = New ASELib.Awk Set Awk = New ASELib.Awk
Awk.ExplicitVariable = True
Awk.ImplicitVariable = False
If Awk.Parse() = -1 Then If Awk.Parse() = -1 Then
MsgBox "ERROR [" + Str(Awk.ErrorLine) + "]" + Awk.ErrorMessage MsgBox "ERROR [" + Str(Awk.ErrorLine) + "]" + Awk.ErrorMessage
Else Else
@ -294,16 +297,8 @@ End Function
Function WriteExtioConsole(ByVal extio As ASELib.AwkExtio, ByVal buf As ASELib.Buffer) As Long Function WriteExtioConsole(ByVal extio As ASELib.AwkExtio, ByVal buf As ASELib.Buffer) As Long
Dim value As String Dim value As String
'Dim value2 As String
'Dim i As Long
value = buf.value value = buf.value
'For i = 0 To 5000000
' value2 = "abc"
' buf.value = "abdkjsdfsafas"
'Next i
ConsoleOut.Text = ConsoleOut.Text + value ConsoleOut.Text = ConsoleOut.Text + value
WriteExtioConsole = Len(value) WriteExtioConsole = Len(value)
End Function End Function