; SketchIt.BAS ; IF (IsReportSecure%() = 0) THEN ForceAutoSave strHold$ = " " lenHold% = LEN( strHold$ ) REGISTER "AIUTIL.DLL", "GRS", "SSSi" sketchPack$ = GetPPS$( "Options", "SketchPack", "", "tra.ini" ) IF sketchPack$ = "" THEN nCount% = 0 IF constant$( "SketchApp" ) <> "not found" THEN sketchPack$ = sketchPack$ + "SKETCH-IT," nCount% = nCount% + 1 END IF ; ApexDir$ = GetPPS$( "apexwin1x", "Path", "", "apexwin.ini" ) a% = GRS%( "Apexwin.Document\\shell\\open\\command", "", strHold$, lenHold% ) IF strHold$ <> "" THEN ; IF ApexDir$ <> "" THEN sketchPack$ = sketchPack$ + ",APEX," nCount% = nCount% + 1 END IF DCDir$ = GetPPS$( "DCSKWIN", "Dir", "", "dcskwin.ini" ) IF DCDir$ <> "" THEN sketchPack$ = sketchPack$ + ",DC SKETCH," nCount% = nCount% + 1 END IF IF sketchPack$ <> "" THEN sketchPack$ = MsgList$(sketchPack$, "Please choose one of these integrated sketch programs.") IF sketchPack$ = "SKETCH-IT" THEN WritePPS "Custom Commands", "SketchIt", "Tools,&Sketch-It Ctrl+Shift+S,sketchit.bas,Ctrl+Shift+S", "tra.ini" ELSEIF sketchPack$ = "APEX" THEN WritePPS "Custom Commands", "SketchIt", "Tools,Apex &Sketch Ctrl+Shift+S,sketchit.bas,Ctrl+Shift+S", "tra.ini" ELSEIF sketchPack$ = "DC SKETCH" THEN WritePPS "Custom Commands", "SketchIt", "Tools,DC &Sketch Ctrl+Shift+S,sketchit.bas,Ctrl+Shift+S", "tra.ini" END IF IF nCount% > 1 THEN IF Ques("Do you want to use " + sketchPack$ + " exclusively from now on?") THEN WritePPS "Options", "SketchPack", sketchPack$, "tra.ini" END IF END IF END IF END IF IF sketchPack$ = "SKETCH-IT" THEN IF HasAddendum%("ua2") THEN Launch("ua2") ; did this for backwards compatibility with old versions... END IF exe$ = constant$( "SketchApp" ) + "\\smsdraw.exe -dde " + constant$( "ReportName" ) ELSEIF sketchPack$ = "APEX" THEN ; Registering CopyFile function. Register "AIUTIL2.DLL", "CopyFile", "SS" ; Copying apexdll.dll to tra\apexwin\ for integration to work. tra_path$ = GetPPS$("Directories", "AppDir", "", "tra.ini") apex_path$ = tra_path$ + "\\apexwin" apexdll_path$ = apex_path$ + "\\apexdll.dll" CopyFile "apexdll.dll", apexdll_path$ ; Adding "Path=" entry to apexwin.ini so that integration will work ; correctly. WritePPS "Apexwin1x", "Path", apex_path$, "apexwin.ini" strHold$ = " " lenHold% = LEN( strHold$ ) a% = GRS%( "Apexwin.Document\\shell\\open\\command", "", strHold$, lenHold% ) IF a% <> 0 THEN pos% = INSTR%( 1, strHold$, "%1" ) IF pos% <> 0 THEN x$ = LEFT$( strHold$, pos% - 2 ) END IF END IF IF LEN(x$) > 0 THEN strDLL$ = LEFT$(x$, LEN(x$) - 11) + "APEXDLL.DLL" IF FILEEXISTS%( strDLL$ ) = 0 THEN WritePPS "Apex", "DLL", strDLL$, "TRA.INI" Wait 2 CALL("apexint.bas") ; copy the DLL to where it needs to be ;REGISTER "AIUTIL.DLL", "CopyFile", "SS" ;IF FILEEXISTS%( "APEXDLL.DLL" ) = 0 thenz ; MSGBOX "NO" ;END IF ;a% = CopyFile%("APEXDLL.DLL", strDLL$) ;MsgBox strDLL$ + ", " + STR$( a% ) END IF exe$ = x$ + " -dde " + constant$("ReportName") END IF ELSEIF sketchPack$ = "DC SKETCH" THEN ; *** This should match the filename specification in DCIMPORT.BAS infofile$ = constant$("TRAPrivate") + "\\dcskinfo.txt" SetRequest "DC_REPORT", constant$("ReportName" ) DCDir$ = GetPPS$( "DCSKWIN", "Dir", "", "dcskwin.ini" ) OPEN infofile$ FOR OUTPUT AS #1 PRINT #1, "OPERATION=E" + chr$(10) PRINT #1, "NOTIFICATION_CODE=1801" + chr$(10) PRINT #1, "APPLICANT=" + cell("offscrn", "Borrower") + chr$(10) PRINT #1, "CLIENT=" + cell("offscrn", "LenderName") + chr$(10) PRINT #1, "SUBJECT_ADDRESS=" + cell("offscrn", "Address") + chr$(10) PRINT #1, "SUBJECT_CITY=" + cell("offscrn", "City") + chr$(10) PRINT #1, "SUBJECT_COUNTY=" + cell("offscrn", "County") + chr$(10) PRINT #1, "SUBJECT_STATE=" + cell("offscrn", "State") + chr$(10) PRINT #1, "SUBJECT_ZIP=" + cell("offscrn", "Zip") + chr$(10) CLOSE #1 exe$ = DCDir$ + " " + cell("offscrn","File#") + " " + infofile$ ELSE IF Ques( "No integrated sketch products have been installed on your computer. Would you like to start another sketch program?" ) THEN exe$ = Inputbox$( "Filename", "Start App", "SMSDRAW.EXE" ) END IF END IF IF exe$ <> "" THEN Shell( exe$ ) END IF ELSE MsgBox "This report has been secured. You should remove security before attempting to modify the property sketch." END IF