Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/ffc/
Upload File :
Current File : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/ffc/_environ.vct

z�VERSION =   3.00_setPcsetcommand
uoldvalue
uoldvalue1
uoldvalue2
lerror
lnorestore
checkvalue
Pixels_runcodePixels8Runs a block of VFP code via macros without compilation.ClassClass1_custom_set
_shellexecutePixelsClass1_custom
_shellexecute1_custom_runcode3*runcode RunCode(cCode[, lFile] [,llgnoreErrors])
:Opens a file in the application that it's associated with.�*shellexecute Runs ShellExecute API routine, which is simlar to double-clicking file in explorer.  Parameters: (cFileName, cWorkDir, cOperation, cParams)
��� hh��%��U;������������%�C����?�
B�������T��C����-T��CC�	tcWorkDirb�C�C����6��=T��CC�tcOperationb�C�C��
	�C����Open6��.T��CC�tnShowWindowb�N����6��.|�ShellExecute�SHELL32.DLL������ B�C���������U
TCFILENAME	TCWORKDIRTCOPERATIONTNSHOWWINDOW
LCFILENAME	LCWORKDIRLCOPERATIONLNSHOWWINDOWSHELLEXECUTESHELL32DLLshellexecute,��1�11��A�����2�)hName = "_shellexecute"
custom	_base.vcx	_base.vcx	_base.vcxcustom$cversion = 1.02
Name = "_runcode"
custom]csetcommand = 
uoldvalue = .NULL.
uoldvalue1 = .NULL.
uoldvalue2 = .NULL.
Name = "_set"
�csetcommand The SET command name.
uoldvalue The original setting of the SET command as SET(<command>).
uoldvalue1 The original setting of the SET command as SET(<command>,1).
uoldvalue2 The original setting of the SET command as SET(<command>,2).
lerror Indicates an error occured during the execution of the SET command.
lnorestore Specifies if the original SET values are restored when the object is released.
*getsetcommand Returns the SET command name.
*restore Restores the original SET settings.
*set Sets environment setting. uArgument1 [, uArgument2] [, lNoRestore]
*get No parameter returns the current SET() value.  1 returns the current SET(,1) value.  2 returns the current SET(,2) value.  0 returns the original SET() value.  -1 returns the original SET(,1) value.  -2 returns the original SET(,2) value.
*disablerestore Disables the automatic restore of settings when in object release mode.
*checkvalue Returns the proper SET(<command>) value baesd on the SET command name.
�Used to save, set, and restore SET commands.  Optional parameters:   uArgument1 [, uArgument2] [, lNoRestore].  This classes only handles SET commands that have a unique first four characters in their name and a few SET commands not fully supported.
W�� >
>
Ԣ	%�
uo��UB�����UTHISCSETCOMMAND������T��a��T��C�����T��C�������T��C�������X%��C���v
�C����
	�&�C���v
�C����
	����T��-���'%��C��v
�
C���
	����T��-���	B����ULLRESULT
LCOLDVALUELCOLDVALUE1LCOLDVALUE2THISGETCSETCOMMANDSET$�����������T���-��%�C���G�B�-���T��C�tuArgument1b��T��C�tuArgument2b��T��CC��	�=���$%�C��
�
��L
	����p�%���C��(�%%���PRIN�
C�f�PRN	���T��� TO���$�T��� TO [��]����L�T��� TO CC��	Z���� SET &lcSetCommand &lcClauses
�$%�C��
�
��L
	������%���C����
T������%���CLAS���COLL���COVE���DATA���DEFA���DEBU���DEVI���DISP���EVEN���FILT���FORM���INDE���KEY���KEYC���LIBR���MACK���MARK���MESS���NOCP���ORDE���PATH���PDSE���POIN���PROC���RELA���SEPA���SKIP���TOPI���TYPE���UDFP���XCMD����T��� TO �������T��� TO CC��	Z���� SET &lcSetCommand &lcClauses
�$%������	C��

	���B�-���UTUARGUMENT1TUARGUMENT2TLDISABLERESTORELCSETCOMMANDLCTYPE1LCTYPE2	LCCLAUSESTHISLERRORCSETCOMMANDDISABLERESTORE<�������T��-��
H�*�,��C�
tnArgumentb�N��a�T��CC��v�����������T������T��a���������T��C���v���������T��C���v�����������T��������������T������2�,�B���	B����U	
TNARGUMENTLCVALUELLADJUSTTHIS
CHECKVALUECSETCOMMAND	UOLDVALUE
UOLDVALUE1
UOLDVALUE2T���a��UTHIS
LNORESTOREl���%�C�tcValueb�C��+�	B�����%�C���=�DEFA��\�B��C��]���	B����UTCVALUETHISCSETCOMMAND �����T���a��UNERRORCMETHODNLINETHISLERROR,���������
T��C�t��=%����C���C���C�tcSetCommandb�C��h�B��T���-��T���CC��f��T���CC��v��	��%�������B�-���T��
�C���v��T���C���v��)%����C�����
	��%�B�-���U
TCSETCOMMANDTUARGUMENT1TUARGUMENT2TLDISABLERESTORELNPARAMETERSTHISLERRORCSETCOMMAND	UOLDVALUE
CHECKVALUE
UOLDVALUE1
UOLDVALUE2SET%%���
���
B�C�����UTHIS
LNORESTORERESTORE
getsetcommand,��restoreR��set���getR��disablerestore���
checkvalue��Error���Init���Destroy�
��1�31�AQQ��Ar�A�3�1�qA��qA!Q��A��AAA!��aQA��AAAqA3q������QQ!!�qA�3�3q��A�A�3��31q��AA�A�qA���qA3�A22P%?&	5@	OK@UhMvlV0gxY��~k��)>
PROCEDURE getsetcommand
RETURN this.cSetCommand

ENDPROC
PROCEDURE restore
LOCAL llResult,lcOldValue,lcOldValue1,lcOldValue2

llResult=.T.
lcOldValue=this.Get(0)
lcOldValue1=this.Get(-1)
lcOldValue2=this.Get(-2)
IF (NOT lcOldValue1==SET(this.cSetCommand,1) AND ;
		NOT this.Set(lcOldValue,lcOldValue1)) OR ;
	(NOT lcOldValue2==SET(this.cSetCommand,2) AND ;
		NOT this.Set(lcOldValue,lcOldValue2))
	llResult=.F.
ENDIF
IF NOT lcOldValue==SET(this.cSetCommand) AND ;
		NOT this.Set(lcOldValue)
	llResult=.F.
ENDIF
RETURN llResult

ENDPROC
PROCEDURE set
LPARAMETERS tuArgument1,tuArgument2,tlDisableRestore
LOCAL lcSetCommand,lcType1,lcType2,lcClauses

this.lError=.F.
IF PARAMETERS()=0
	RETURN .F.
ENDIF
lcType1=TYPE("tuArgument1")
lcType2=TYPE("tuArgument2")
lcSetCommand=ALLTRIM(LEFT(this.cSetCommand,4))
IF NOT ISNULL(tuArgument2) AND NOT lcType2=="L" OR tuArgument2
	IF lcType2=="C"
		IF lcSetCommand=="PRIN" AND UPPER(tuArgument2)=="PRN"
			lcClauses=" TO"
		ELSE
			lcClauses=" TO ["+tuArgument2+"]"
		ENDIF
	ELSE
		lcClauses=" TO "+ALLTRIM(STR(tuArgument2,9))
	ENDIF
	SET &lcSetCommand &lcClauses
ENDIF
IF NOT ISNULL(tuArgument1) AND NOT lcType1=="L" OR tuArgument1
	IF lcType1=="C"
		lcClauses=tuArgument1
		IF lcSetCommand=="CLAS" OR lcSetCommand=="COLL" OR ;
				lcSetCommand=="COVE" OR lcSetCommand=="DATA" OR ;
				lcSetCommand=="DEFA" OR lcSetCommand=="DEBU" OR ;
				lcSetCommand=="DEVI" OR lcSetCommand=="DISP" OR ;
				lcSetCommand=="EVEN" OR lcSetCommand=="FILT" OR ;
				lcSetCommand=="FORM" OR lcSetCommand=="INDE" OR ;
				lcSetCommand=="KEY" OR 	lcSetCommand=="KEYC" OR ;
				lcSetCommand=="LIBR" OR lcSetCommand=="MACK" OR ;
				lcSetCommand=="MARK" OR lcSetCommand=="MESS" OR ;
				lcSetCommand=="NOCP" OR lcSetCommand=="ORDE" OR ;
				lcSetCommand=="PATH" OR lcSetCommand=="PDSE" OR ;
				lcSetCommand=="POIN" OR lcSetCommand=="PROC" OR ;
				lcSetCommand=="RELA" OR lcSetCommand=="SEPA" OR ;
				lcSetCommand=="SKIP" OR lcSetCommand=="TOPI" OR ;
				lcSetCommand=="TYPE" OR lcSetCommand=="UDFP" OR ;
				lcSetCommand=="XCMD"
			lcClauses=" TO "+lcClauses
		ENDIF
	ELSE
		lcClauses=" TO "+ALLTRIM(STR(tuArgument1,9))
	ENDIF
	SET &lcSetCommand &lcClauses
ENDIF
IF this.lError OR (tlDisableRestore AND NOT this.DisableRestore())
	RETURN .F.
ENDIF

ENDPROC
PROCEDURE get
LPARAMETERS tnArgument
LOCAL lcValue,llAdjust

llAdjust=.F.
DO CASE
	CASE TYPE("tnArgument")#"N"
		lcValue=this.CheckValue(SET(this.cSetCommand))
	CASE tnArgument=0
		lcValue=this.uOldValue
		llAdjust=.T.
	CASE tnArgument=1
		lcValue=SET(this.cSetCommand,1)
	CASE tnArgument=2
		lcValue=SET(this.cSetCommand,2)
	CASE tnArgument=-1
		lcValue=this.uOldValue1
	CASE tnArgument=-2
		lcValue=this.uOldValue2
	OTHERWISE
		RETURN .NULL.
ENDCASE
RETURN lcValue

ENDPROC
PROCEDURE disablerestore
this.lNoRestore=.T.

ENDPROC
PROCEDURE checkvalue
LPARAMETERS tcValue

IF TYPE("tcValue")#"C"
	RETURN tcValue
ENDIF
IF LEFT(this.cSetCommand,4)=="DEFA"
	RETURN tcValue+SYS(2003)
ENDIF
RETURN tcValue

ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine

this.lError=.T.

ENDPROC
PROCEDURE Init
LPARAMETERS tcSetCommand,tuArgument1,tuArgument2,tlDisableRestore
LOCAL lnParameters

lnParameters=PCOUNT()
IF lnParameters=0 OR EMPTY(tcSetCommand) OR ISNULL(tcSetCommand) OR ;
		TYPE("tcSetCommand")#"C"
	RETURN
ENDIF
this.lError=.F.
this.cSetCommand=UPPER(ALLTRIM(tcSetCommand))
this.uOldValue=this.CheckValue(SET(this.cSetCommand))
IF this.lError
	RETURN .F.
ENDIF
this.uOldValue1=SET(this.cSetCommand,1)
this.uOldValue2=SET(this.cSetCommand,2)
IF lnParameters>=2 AND ;
		NOT this.Set(tuArgument1,tuArgument2,tlDisableRestore)
	RETURN .F.
ENDIF

ENDPROC
PROCEDURE Destroy
IF NOT this.lNoRestore
	RETURN this.Restore()
ENDIF

ENDPROC
O�� 6668%�����U��������������	���
���
��������������������������� �!�"�+��#����$����%����&�������#�$�%�&�%�C����C���T��C�����1�!T��C��
�=.F.��__6���T�	�� 06.0Ch��%��	
����T��C�ERROR���
%������1�=.F.����{���T��a��
%������
T�����T��CC��̛�����#T��CC����C����6���%�C��=�;��5�T��C��;C�
 C�
 ����#T��C�ExecScript(__lcCode)��%�C����s�{�����ON ERROR &__lcLastOnError
�	B����� T��C�__tcCode[1]b�C��
%������T��C���#�
���-�%�C����C�C�����B��
%����]�
T�����T��CC��̛��%�C����Y�B���t�T��C�����%�C��=�;����T��C��;C�
 C�
 ����T��C��#����%�������B��5�'�
T�'����
T�����+���
��)�T������T��CC��#���T�
�C�&�&���%��
���x�T��CC��
�=����+�a��,�T��C��=��%��� �
�C�	 ����T��CC��\���.��T��C��R��%��� �
�C�	 ��$�T��CC�C�>�=`��.��!��r%�C���C��=�*�C��=�#�C��=�&�&�CC��=f�NOTE�C��=�<!--������C�#����T������
�#����T������.��*%����CC���#�R�;	��
�(T��CC���#CC���#>�=��+�a����T��C��R��%��� �
�C�	 ����T��CC�C�>�=`��.��!��T������T���� �����C�#����T������
�#����T�#��������%�T�#����������%�����F�B��T��C�ERROR���
%����x�1�=.F.����{���T��a��
T�����J�-�(���J���(����9J���(���������� �!�"�+���
��P�T������T��C��#��%�C����I�.��%�C��=�=��x���CC��\��.��T�
�CC��=f��J%��
�DO W�2CC��=f�DO WHIL �CC��=f�DO WHILE	����T�
��DO_W��
T������
	�
T������T�
�C� �
���T��CC�	 �
���%�C���
���`	�
T�
�����%��
����	�T�
�C�
�
�=���T�
�C� ����T��CC�	 ����%�C���
����	�
T�
�����%��
���
�
T������ 
�T��CC��
�\����
T�'����
H�>
�T���
�ENDT��b
�T��-��.�
�����
�T���\���
T�'����
&__lcLine
.���
�DO_W���%�����"�	���T������%������
T�����
T�����.�����
�FOR����%�����"�	����T������%�������T�
�C� TO ����%��
�����
T�����
T�����
T�����.��
T�����T��CC��
�=���T��CC��
�\���T�
�C�=����%��
���%�.��&__lcForExpr
T��CC��
�=���T�
�C� STEP ����%��
�����T��C���
T��������T��CC��
�=��T��CC��
�\���
T�����.�����
�IF��q
�%������	��m
�T�"��"���%��"���i
�
T�����T��C���
T� ����.�����
�ELSE���
�'%��"����	���	���
�T���
��.����
�ENDD��=�%��"����	��9�T������%�����5�+�C��
�C��	����T��C�&-��(�)��%�CC��&����
%����|�T�������%�C������{�����ON ERROR &__lcLastOnError
�	B�����%��
����!���
T�����T�*�-��
T�����
�&����T�&�-��
T�����.�����
�ENDF���%��"����	���T������%������%�������+�C������T��C�$-��(�)��%�CC��$��M�
%�����T�������%�C�����{���@�ON ERROR &__lcLastOnError
�	B�����%��
��c�!��!T����=��+C�_��
&__lcExpr
����+�C������T��C�$-��(�)��%�CC��$��M�
%�����T�������%�C�����{���@�ON ERROR &__lcLastOnError
�	B�����%��
��c�!��!T����=��+C�_��
&__lcExpr
��
T�����
T�+����
T�����
T�����
T�����
�$����T�$�-��
T�����.�����
�ENDI��T�%������	��P�T�"��"���%��"���L�T��C�%-��(�)��%�CC��%����
%������T�������%�C������{�����ON ERROR &__lcLastOnError
�	B�����
T�����T��-��
T� ����
�%����T�%�-��
T�!����.����%�������T������
�&����T�&�������.��%������	����T������
�$����T�$�������.��%��"���S�%��
���.��T�!��!���
�%��!��T�%��!�����.��
H�d�?���
�RETU����
%������T�������%�C��
����T��C����!���
�EXIT����
%������T��-���!���
�TEXT���T��a��.���
�ENDT��?�T��-��.��
&__lcLine
�%�C����k�{�����ON ERROR &__lcLastOnError
�	B����U,__TCCODE__TLFILE__TVIGNOREERRORS__LCCODE__LCONERROR
__LLARRAYCODE__LCLINE__LNLINE	__LCLINE2	__LLVFP60__LCCOMMAND__LCEXPR__LCCHAR	__LNATPOS
__LNATPOS2__LNOCCURRENCE
__LNLINETOTAL__LLTEXTMODE__LCLASTONERROR
__LVRESULT
__LCDOEXPR
__LNDOLINE__LNDOLINETOTAL__LNDOSTACKCOUNT__LCFOREXPR
__LNFORMAX__LNFORSTEP__LNFORLINE__LNFORLINETOTAL__LNFORSTACKCOUNT
__LCIFEXPR
__LLIFEXPR
__LNIFLINE__LNIFLINETOTAL__LNIFSTACKCOUNT	__LALINES__LAFORLINES__LAIFLINES__LADOLINES__LCLASTLINETHISRUNCODE
__LLDOEXPR__LNFORCOUNTS�����%����
�C����3�B�-�����C�����B�UNERRORCMETHODNLINETHIS
LIGNOREERRORS	STARTMODEruncode,��Error��1@���11�q��W��AQ�Q����A���!�1Aq�A1����A�A�a��AA��!�AA��Aq�AQAAq��!A��A�!�AAA!��AAAA#�AA���!��AAAAa�1�1AAAAAQ����A���Q�!!�AAqAAA����AaqQ�AaAaqQ�A���A��Q�A�!��AQ���AAAA�a���AA���1AA�������A�AAA1����AAAQq�AAQ���1�A����A�A�AAA������AAAQ�A�1�A����A�A�AA�A�A�1�A����A�A�AA�AA��������AAAQ��1�A����A�A������AAAA�1AA��1AA�AA�1AA�Q�A�AAQ��AAQ�AQ�AA�A����A�3��qAQA2�*�+�+�)6+�PROCEDURE runcode
* RunCode.PRG - Run code block interpreter.
* Version 2.00
*
* Copyright (c) 1998-1999 Microsoft Corp.
* 1 Microsoft Way
* Redmond, WA 98052
*
* Description:
* Runs a block of VFP code via macros without compilation.
*
* Parameter list:
* cCode:	Code to execute or file name that contains code to execute
* lFile:	Specifies source file mode.
*				.F./Empty = Code is specified by cCode.
*				.T. = Code is imported from specified file via cCode value.
* lIgnoreErrors:	Specifies error handling mode.
*				.F./Empty = Errors are trapped and displayed in a wait window.
*				.T. = All errors are ignored.


LPARAMETERS __tcCode,__tlFile,__tvIgnoreErrors
LOCAL __lcCode,__lcOnError,__llArrayCode,__lcLine,__lnLine,__lcLine2,__llVFP60
LOCAL __lcCommand,__lcExpr,__lcChar,__lnAtPos,__lnAtPos2,__lnOccurrence
LOCAL __lnLineTotal,__llTextMode,__lcLastOnError,__lvResult
LOCAL __lcDoExpr,__lnDoLine,__lnDoLineTotal,__lnDoStackCount
LOCAL __lcForExpr,__lnForMax,__lnForStep,__lnForLine,__lnForLineTotal,__lnForStackCount
LOCAL __lcIfExpr,__llIfExpr,__lnIfLine,__lnIfLineTotal,__lnIfStackCount
LOCAL __laLines[1],__laForLines[1],__laIfLines[1],__laDoLines[1]
EXTERNAL ARRAY __tcCode,__laLines,__laForLines,__laIfLines,__laDoLines

#DEFINE TAB		CHR(9)
#DEFINE LF		CHR(10)
#DEFINE CR		CHR(13)
#DEFINE CR_LF	CR+LF

IF VARTYPE(__tvIgnoreErrors)=="C"
	__lcOnError=ALLTRIM(__tvIgnoreErrors)
ELSE
	__lcOnError=IIF(__tvIgnoreErrors,"=.F.","__")
ENDIF
__llVFP60=" 06.0"$VERSION()
IF NOT __llVFP60
	__lcLastOnError=ON("ERROR")
	IF __tvIgnoreErrors
		ON ERROR =.F.
	ELSE
		ON ERROR
	ENDIF
	__lvResult=.T.
	IF __tlFile
		__lcCode=""
		__lcCode=ALLTRIM(FILETOSTR(__tcCode))
	ELSE
		__lcCode=IIF(VARTYPE(__tcCode)=="C",__tcCode,"")
	ENDIF
	IF LEFT(__lcCode,1)==";"
		__lcCode=STRTRAN(__lcCode,";",CR_LF)
	ENDIF
	__lvResult=EVALUATE("ExecScript(__lcCode)")
	IF EMPTY(__lcLastOnError)
		ON ERROR
	ELSE
		ON ERROR &__lcLastOnError
	ENDIF
	RETURN __lvResult
ENDIF
__llArrayCode=(TYPE("__tcCode[1]")=="C")
IF __llArrayCode
	__lnLineTotal=ACOPY(__tcCode,__laLines)
ELSE
	IF VARTYPE(__tcCode)#"C" OR EMPTY(__tcCode)
		RETURN
	ENDIF
	IF __tlFile
		__lcCode=""
		__lcCode=ALLTRIM(FILETOSTR(__tcCode))
		IF EMPTY(__lcCode)
			RETURN
		ENDIF
	ELSE
		__lcCode=ALLTRIM(__tcCode)
	ENDIF
	IF LEFT(__lcCode,1)==";"
		__lcCode=STRTRAN(__lcCode,";",CR_LF)
	ENDIF
	__lnLineTotal=ALINES(__laLines,__lcCode)
	IF __lnLineTotal=0
		RETURN
	ENDIF
	PRIVATE __lcLastLine
	__lcLastLine=""
	__lnLine=0
	DO WHILE __lnLine<__lnLineTotal
		__lnLine=__lnLine+1
		__lcLine=ALLTRIM(__laLines[__lnLine])
		__lnAtPos=AT("&"+"&",__lcLine)
		IF __lnAtPos>0
			__lcLine=ALLTRIM(LEFT(__lcLine,__lnAtPos-1))
		ENDIF
		DO WHILE .T.
			__lcChar=LEFT(__lcLine,1)
			IF __lcChar==" " OR __lcChar==TAB
				__lcLine=ALLTRIM(SUBSTR(__lcLine,2))
				LOOP
			ENDIF
			__lcChar=RIGHT(__lcLine,1)
			IF __lcChar==" " OR __lcChar==TAB
				__lcLine=TRIM(LEFT(__lcLine,LEN(__lcLine)-1))
				LOOP
			ENDIF
			EXIT
		ENDDO
		IF EMPTY(__lcLine) OR LEFT(__lcLine,1)=="*" OR LEFT(__lcLine,1)=="#" OR ;
				LEFT(__lcLine,2)==("&"+"&") OR UPPER(LEFT(__lcLine,4))=="NOTE" OR ;
				LEFT(__lcLine,4)=="<!--"
			ADEL(__laLines,__lnLine)
			__lnLineTotal=__lnLineTotal-1
			DIMENSION __laLines[__lnLineTotal]
			__lnLine=__lnLine-1
			LOOP
		ENDIF
		IF __lnLine>=2 AND RIGHT(__laLines[__lnLine-1],1)==";"
			__lcLine2=LEFT(__laLines[__lnLine-1],LEN(__laLines[__lnLine-1])-1)
			DO WHILE .T.
				__lcChar=RIGHT(__lcLine2,1)
				IF __lcChar==" " OR __lcChar==TAB
					__lcLine2=TRIM(LEFT(__lcLine2,LEN(__lcLine2)-1))
					LOOP
				ENDIF
				EXIT
			ENDDO
			__lnLine=__lnLine-1
			__lcLine=__lcLine2+" "+__lcLine
			ADEL(__laLines,__lnLine)
			__lnLineTotal=__lnLineTotal-1
			DIMENSION __laLines[__lnLineTotal]
			__laLines[__lnLine]=__lcLine
		ELSE
			__laLines[__lnLine]=__lcLine
		ENDIF
	ENDDO
ENDIF
IF __lnLineTotal=0
	RETURN
ENDIF
__lcLastOnError=ON("ERROR")
IF __tvIgnoreErrors
	ON ERROR =.F.
ELSE
	ON ERROR
ENDIF
__lvResult=.T.
__lcLine=""
STORE .F. TO __llIfExpr,__llTextMode
STORE "" TO __lcDoExpr,__lcForExpr,__lcIfExpr
STORE 0 TO __lnLine,__lnDoLine,__lnDoLineTotal,__lnDoStackCount, ;
		__lnForLine,__lnForLineTotal,__lnForStackCount,__lnForMax, ;
		__lnForStep,__lnIfLine,__lnIfLineTotal,__lnIfStackCount
DO WHILE __lnLine<__lnLineTotal
	__lnLine=__lnLine+1
	__lcLine=__laLines[__lnLine]
	IF EMPTY(__lcLine)
		LOOP
	ENDIF
	IF LEFT(__lcLine,1)=="="
		EVALUATE(SUBSTR(__lcLine,2))
		LOOP
	ENDIF
	__lcCommand=UPPER(LEFT(__lcLine,4))
	IF __lcCommand=="DO W" AND (UPPER(LEFT(__lcLine,8))=="DO WHIL " OR ;
			UPPER(LEFT(__lcLine,8))=="DO WHILE")
		__lcCommand="DO_W"
		__lnOccurrence=2
	ELSE
		__lnOccurrence=1
	ENDIF
	__lnAtPos=AT(" ",__lcCommand,__lnOccurrence)
	__lnAtPos2=AT(TAB,__lcCommand,__lnOccurrence)
	IF BETWEEN(__lnAtPos2,1,__lnAtPos)
		__lnAtPos=__lnAtPos2
	ENDIF
	IF __lnAtPos>0
		__lcCommand=LEFT(__lcCommand,__lnAtPos-1)
	ENDIF
	__lnAtPos=AT(" ",__lcLine,__lnOccurrence)
	__lnAtPos2=AT(TAB,__lcLine,__lnOccurrence)
	IF BETWEEN(__lnAtPos2,1,__lnAtPos)
		__lnAtPos=__lnAtPos2
	ENDIF
	IF __lnAtPos=0
		__lcExpr=""
	ELSE
		__lcExpr=ALLTRIM(SUBSTR(__lcLine,__lnAtPos+1))
	ENDIF
	__lcLastLine=__lcLine
	DO CASE
		CASE __lcCommand=="ENDT"
			__llTextMode=.F.
			LOOP
		CASE __llTextMode
			__lcLine="\"+__lcLine
			__lcLastLine=__lcLine
			&__lcLine
			LOOP
		CASE __lcCommand=="DO_W"
			IF __lnForStackCount<=0 AND __lnIfStackCount<=0
				__lnDoStackCount=__lnDoStackCount+1
				IF __lnDoStackCount<=1
					__lcDoExpr=__lcExpr
					__lnDoLine=__lnLine
					LOOP
				ENDIF
			ENDIF
		CASE __lcCommand=="FOR"
			IF __lnDoStackCount<=0 AND __lnIfStackCount<=0
				__lnForStackCount=__lnForStackCount+1
				IF __lnForStackCount<=1
					__lnAtPos=ATC(" TO ",__lcExpr)
					IF __lnAtPos=0
						__lcForExpr=""
						__lnForMax=0
						__lnForStep=0
						LOOP
					ENDIF
					__lcForExpr=__lcExpr
					__lcForExpr=ALLTRIM(LEFT(__lcExpr,__lnAtPos-1))
					__lcExpr=ALLTRIM(SUBSTR(__lcExpr,__lnAtPos+4))
					__lnAtPos=ATC("=",__lcForExpr)
					IF __lnAtPos=0
						LOOP
					ENDIF
					&__lcForExpr
					__lcForExpr=ALLTRIM(LEFT(__lcForExpr,__lnAtPos-1))
					__lnAtPos=ATC(" STEP ",__lcExpr)
					IF __lnAtPos=0
						__lnForMax=EVALUATE(__lcExpr)
						__lnForStep=1
					ELSE
						__lnForMax=EVALUATE(LEFT(__lcExpr,__lnAtPos-1))
						__lnForStep=EVALUATE(SUBSTR(__lcExpr,__lnAtPos+6))
					ENDIF
					__lnForLine=__lnLine
					LOOP
				ENDIF
			ENDIF
		CASE __lcCommand=="IF"
			IF __lnDoStackCount<=0 AND __lnForStackCount<=0
				__lnIfStackCount=__lnIfStackCount+1
				IF __lnIfStackCount<=1
					__lcIfExpr=__lcExpr
					__llIfExpr=EVALUATE(__lcIfExpr)
					__lnIfLine=__lnLine
					LOOP
				ENDIF
			ENDIF
		CASE __lcCommand=="ELSE"
			IF __lnIfStackCount=1 AND __lnDoStackCount<=0 AND __lnForStackCount<=0
				__llIfExpr=(NOT __llIfExpr)
				LOOP
			ENDIF
		CASE __lcCommand=="ENDD"
			IF __lnIfStackCount<=0 AND __lnForStackCount<=0
				__lnDoStackCount=__lnDoStackCount-1
				IF __lnDoStackCount<=0
					DO WHILE NOT EMPTY(__lcDoExpr) AND EVALUATE(__lcDoExpr)
						__lvResult=this.RunCode(@__laDoLines,.F.,__tvIgnoreErrors)
						IF ISNULL(__laDoLines[1])
							IF __llArrayCode
								__tcCode[1]=.NULL.
							ENDIF
							IF EMPTY(__lcLastOnError)
								ON ERROR
							ELSE
								ON ERROR &__lcLastOnError
							ENDIF
							RETURN __lvResult
						ENDIF
						IF NOT __lvResult
							EXIT
						ENDIF
					ENDDO
					__lcDoExpr=""
					__llDoExpr=.F.
					__lnDoLine=0
					DIMENSION __laDoLines[1]
					__laDoLines=.F.
					__lnDoLineTotal=0
					LOOP
				ENDIF
			ENDIF
		CASE __lcCommand=="ENDF"
			IF __lnIfStackCount<=0 AND __lnDoStackCount<=0
				__lnForStackCount=__lnForStackCount-1
				IF __lnForStackCount<=0
					IF __lnForStep>0
						DO WHILE EVALUATE(__lcForExpr)<=__lnForMax
							__lvResult=this.RunCode(@__laForLines,.F.,__tvIgnoreErrors)
							IF ISNULL(__laForLines[1])
								IF __llArrayCode
									__tcCode[1]=.NULL.
								ENDIF
								IF EMPTY(__lcLastOnError)
									ON ERROR
								ELSE
									ON ERROR &__lcLastOnError
								ENDIF
								RETURN __lvResult
							ENDIF
							IF NOT __lvResult
								EXIT
							ENDIF
							__lcExpr=__lcForExpr+"="+__lcForExpr+"+"+TRANSFORM(__lnForStep)
							&__lcExpr
						ENDDO
					ELSE
						DO WHILE EVALUATE(__lcForExpr)>=__lnForMax
							__lvResult=this.RunCode(@__laForLines,.F.,__tvIgnoreErrors)
							IF ISNULL(__laForLines[1])
								IF __llArrayCode
									__tcCode[1]=.NULL.
								ENDIF
								IF EMPTY(__lcLastOnError)
									ON ERROR
								ELSE
									ON ERROR &__lcLastOnError
								ENDIF
								RETURN __lvResult
							ENDIF
							IF NOT __lvResult
								EXIT
							ENDIF
							__lcExpr=__lcForExpr+"="+__lcForExpr+"+"+TRANSFORM(__lnForStep)
							&__lcExpr
						ENDDO
					ENDIF
					__lcForExpr=""
					__lnForCount=0
					__lnForMax=0
					__lnForStep=0
					__lnForLine=0
					DIMENSION __laForLines[1]
					__laForLines=.F.
					__lnForLineTotal=0
					LOOP
				ENDIF
			ENDIF
		CASE __lcCommand=="ENDI"
			IF __lnDoStackCount<=0 AND __lnForStackCount<=0
				__lnIfStackCount=__lnIfStackCount-1
				IF __lnIfStackCount<=0
					__lvResult=this.RunCode(@__laIfLines,.F.,__tvIgnoreErrors)
					IF ISNULL(__laIfLines[1])
						IF __llArrayCode
							__tcCode[1]=.NULL.
						ENDIF
						IF EMPTY(__lcLastOnError)
							ON ERROR
						ELSE
							ON ERROR &__lcLastOnError
						ENDIF
						RETURN __lvResult
					ENDIF
					__lcIfExpr=""
					__llIfExpr=.F.
					__lnIfLine=0
					DIMENSION __laIfLines[1]
					__laIfLines=.F.
					__lnIfLineTotal=0
					LOOP
				ENDIF
			ENDIF
	ENDCASE
	IF __lnDoStackCount>0
		__lnDoLineTotal=__lnDoLineTotal+1
		DIMENSION __laDoLines[__lnDoLineTotal]
		__laDoLines[__lnDoLineTotal]=__lcLine
		LOOP
	ENDIF
	IF __lnForStackCount>0 AND __lnDoStackCount<=0
		__lnForLineTotal=__lnForLineTotal+1
		DIMENSION __laForLines[__lnForLineTotal]
		__laForLines[__lnForLineTotal]=__lcLine
		LOOP
	ENDIF
	IF __lnIfStackCount>0
		IF NOT __llIfExpr
			LOOP
		ENDIF
		__lnIfLineTotal=__lnIfLineTotal+1
		DIMENSION __laIfLines[__lnIfLineTotal]
		__laIfLines[__lnIfLineTotal]=__lcLine
		LOOP
	ENDIF
	DO CASE
		CASE __lcCommand=="RETU"
			IF __llArrayCode
				__tcCode[1]=.NULL.
			ENDIF
			IF NOT EMPTY(__lcExpr)
				__lvResult=EVALUATE(__lcExpr)
			ENDIF
			EXIT
		CASE __lcCommand=="EXIT"
			IF __llArrayCode
				__lvResult=.F.
			ENDIF
			EXIT
		CASE __lcCommand=="TEXT"
			__llTextMode=.T.
			LOOP
		CASE __lcCommand=="ENDT"
			__llTextMode=.F.
			LOOP
	ENDCASE
	&__lcLine
ENDDO
IF EMPTY(__lcLastOnError)
	ON ERROR
ELSE
	ON ERROR &__lcLastOnError
ENDIF
RETURN __lvResult

ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine

IF this.lIgnoreErrors OR _vfp.StartMode>0
	RETURN .F.
ENDIF
DODEFAULT(nError, cMethod, nLine)
return

ENDPROC
�PROCEDURE shellexecute
* WinApi :: ShellExecute
**  Function: Opens a file in the application that it's
**            associated with.
**      Pass: lcFileName -  Name of the file to open
**   
**  Return:   2  - Bad Association (e.g., invalid URL)
**            31 - No application association
**            29 - Failure to load application
**            30 - Application is busy 
**
**            Values over 32 indicate success
**            and return an instance handle for
**            the application started (the browser) 
**
** ShowWindow() Commands
**  #define SW_HIDE             0
**  #define SW_SHOWNORMAL       1
**  #define SW_NORMAL           1
**  #define SW_SHOWMINIMIZED    2
**  #define SW_SHOWMAXIMIZED    3
**  #define SW_MAXIMIZE         3
**  #define SW_SHOWNOACTIVATE   4
**  #define SW_SHOW             5
**  #define SW_MINIMIZE         6
**  #define SW_SHOWMINNOACTIVE  7
**  #define SW_SHOWNA           8
**  #define SW_RESTORE          9
**  #define SW_SHOWDEFAULT      10
**  #define SW_FORCEMINIMIZE    11
**  #define SW_MAX              11

LPARAMETERS tcFileName,tcWorkDir,tcOperation,tnShowWindow
LOCAL lcFileName,lcWorkDir,lcOperation,lnShowWindow

IF EMPTY(tcFileName)
	RETURN -1
ENDIF

lcFileName=ALLTRIM(tcFileName)
lcWorkDir=IIF(TYPE("tcWorkDir")="C",ALLTRIM(tcWorkDir),"")
lcOperation=IIF(TYPE("tcOperation")="C" AND NOT EMPTY(tcOperation),ALLTRIM(tcOperation),"Open")
lnShowWindow=IIF(TYPE("tnShowWindow")="N",tnShowWindow,1)

*-* HINSTANCE ShellExecute(hwnd, lpszOp, lpszFile, lpszParams, lpszDir, wShowCmd)
*-* 
*-* HWND hwnd - handle of parent window
*-* LPCTSTR lpszOp - address of string for operation to perform
*-* LPCTSTR lpszFile - address of string for filename
*-* LPTSTR lpszParams - address of string for executable-file parameters
*-* LPCTSTR lpszDir - address of string for default directory
*-* INT wShowCmd - whether file is shown when opened
DECLARE INTEGER ShellExecute ;
	    IN SHELL32.DLL ;
	    INTEGER nWinHandle,;
	    STRING cOperation,;   
	    STRING cFileName,;
	    STRING cParameters,;
	    STRING cDirectory,;
	    INTEGER nShowWindow
RETURN ShellExecute(0,lcOperation,lcFilename,"",lcWorkDir,lnShowWindow)

ENDPROC