#IFNDEF GET_SHELLEXECUTE // external function call used in Procedure DoStartDocument External_Function ShellExecute "ShellExecuteA" shell32.dll ; Handle hWnd ; String lpOperation ; String lpFile ; String lpParameters ; String lpDirectory ; Dword iShowCmd Returns Handle #ENDIF // this will perform an operation on a file (e.g. open) with the application // registered in the Windows Registry to open that type of file (via its extension) // sOperation would be "OPEN" (it could also be "PRINT" etc). Procedure DoStartDocument Global String sOperation String sDocument Handle hInstance hWnd Get Window_Handle To hWnd Move (ShellExecute (hWnd, sOperation, (Trim (sDocument)), '', '', 1)) To hInstance End_Procedure Function ParseString String sString String sSeparator Returns Integer Integer iCnt p hoRetVal String sTemp Object oArray is an Array Move Self to hoRetVal End_Object Move (Trim(sString)+sSeparator) to sString While (sString<>'') Move (Pos(sSeparator,sString)) to p Move (Left(sString,p-1)) to sTemp Get item_count of hoRetVal to iCnt Set Value of hoRetVal Item iCnt to sTemp Move (Mid(sString,Length(sString),p+1)) to sString Loop Function_Return hoRetVal End_Function Function ParseString2 Global String sStr String sDelim Returns String[] String[] sRetVal Integer i If (Right(sStr,1)<>sDelim) Begin Move (sStr+sDelim) to sStr End Repeat Move (Left(sStr,Pos(sDelim,sStr)-1)) to sRetVal[i] Add 1 to i Move (Mid(sStr,Length(sStr),Pos(sDelim,sStr)+1)) to sStr Until (sStr='') Function_Return sRetVal End_Function Function ParseString3 Global String sStr String sDelim String sGroup Returns String[] String[] sRetVal Integer i p If (Right(sStr,1)<>sDelim) Begin Move (sStr+sDelim) to sStr End Repeat If (Left(sStr,1)=sGroup) Begin Move (Pos(sGroup,sStr,2)) to p If (p=0) Begin Move (Length(sStr)) to p End Move (Mid(sStr,p-2,2)) to sRetVal[i] Add 1 to i Move (Mid(sStr,Length(sStr),p+2)) to sStr End Else Begin Move (Left(sStr,Pos(sDelim,sStr)-1)) to sRetVal[i] Add 1 to i Move (Mid(sStr,Length(sStr),Pos(sDelim,sStr)+1)) to sStr End Until (sStr='') Function_Return sRetVal End_Function