Index: HADWIZ.mac.rou =================================================================== diff -u -r2200 -r3690 --- HADWIZ.mac.rou (.../HADWIZ.mac.rou) (revision 2200) +++ HADWIZ.mac.rou (.../HADWIZ.mac.rou) (revision 3690) @@ -80,16 +80,26 @@ If (X="T"),$G(PRNr)?4.7N,$D(^HADPR("P",PRNr,"BP")) Set ^IPCom("D",Key,"P","DFLREF")=$NA(^HADPR("P",PRNr,"BP")),^IPCom("D",Key,"P","DFLPR")=PRNr ; Start Applicatie Set FP=2001 Write @F,"VBA:\\" + + New IsCancelled,CanQuitECPWaitingLoop + Set IsCancelled=0 + ; Terugkeer van VBA If ViaIPCom Do . Set FP=2320 Write @F Read Qty ; Wachten op terugkeer + . Set CanQuitECPWaitingLoop = 0 + . For i = 1 : 1 : 100 Do Quit:(CanQuitECPWaitingLoop) Hang 0.1 ; met interval van 0.1 sec checken of ^IPCom() ingevuld is (global mapping via ECP). --> max 100 iteraties = 10 sec wachten + . . Set IsCancelled=($G(^IPCom("D",Key,"P","DialogResult"))="CANCELLED") + . . Set PRNr=$G(^IPCom("D",Key,"P","PRNR")) + . . Set CanQuitECPWaitingLoop=(IsCancelled)||($length(PRNr)) . Set Qty=$G(^IPCom("D",Key,"P","AANTAL")) - . Set PRNr=$G(^IPCom("D",Key,"P","PRNR")) + . ;d WLIP^vhDBG(97,$$$ArrayTT($Na(^IPCom("D",Key)))) Else Do . Set FP=2320 Write @F Read Qty . Set FP=2415 Write @F Read PRNr Kill ^IPCom("D",Key) - Quit:PRNr="" "" + Quit:(IsCancelled)||(PRNr="") "" + If PRNr'?4.7N||'$D(^KPR(PRNr)) Do WARN^vhTXTPOP("Foutief produktID, verwittig ICT") Quit "" Do AdaptPlanilak Do RECALC^PRODUKT2(PRNr)