DODEFAULT() * select out the orders that have been ticked to be signed for SELECT tempdespatch SELECT * ; FROM tempdespatch ; WHERE destrue = .T. ; INTO CURSOR selectedorders NOFILTER SELECT selectedorders IF NOT EOF() LOCAL epad1, result6, morderref, mitrlink, filename7, iferror, ifok iferror = 0 ifok = 0 TRY * this initialises the epad signing object epad1 = NEWOBJECT("esW25COM.escapture") * calling the epad signature screen result6 = epad1.StartSign IF result6 = 1 * the OK button was pressed IF epad1.issigned = 0 * there is no signature, epad software should take care of this itself * this will never happen, but just in case MESSAGEBOX("No signature recorded, please try again",48,"Warning") ELSE * there is a signature entered, confirm the saving of the signature IF MESSAGEBOX("Save all the details now?",36,"Save") = 6 * loop through all of the selected orders and save the signature for each one SELECT selectedorders GO TOP DO WHILE NOT EOF() morderref = ALLTRIM(ordref) mitrlink = ALLTRIM(STR(itrlink)) IF morderref <> " " ifok = ifok + 1 filename7 = SYS(5) + SYS(2003) + "\signatures\" + STRTRAN(morderref,'/','-') + ".jpg" * parameters (filename,width,height,filetype(1=jpg:0=bmp),% quality of image: 80 is default) epad1.SaveToFile(filename7,300,200,1,80) ELSE * this should never happen as all order have to have an order number iferror = iferror + 1 MESSAGEBOX("Problem with this line = " + mitrlink + " , contact Kernel",16,"Warning") ENDIF SELECT selectedorders SKIP LOOP ENDDO IF iferror = 0 MESSAGEBOX("Signature saved for " + ALLTRIM(STR(ifok)) + " Lines",64,"Saved") ELSE * should never really end up in here as only blank order number causes this MESSAGEBOX("There was a problem with " + ALLTRIM(STR(iferror)) + " lines, " + ; + ALLTRIM(STR(ifok)) + " lines saved ok",64,"Problem") ENDIF * we are finished close the signature object epad1 = .NULL. ELSE epad1 = .NULL. MESSAGEBOX("No signature saved",64,"Information") ENDIF ENDIF ELSE * the cancel button was pressed epad1 = .NULL. MESSAGEBOX("No signature saved, please try again",48,"Warning") ENDIF CATCH MESSAGEBOX("problem with signing",16,"Warning") FINALLY * no code to go in here ENDTRY ELSE * no transactions were selected MESSAGEBOX("No despatches selected to sign for",64,"Warning") ENDIF>Mark