Help with Dialog ActionLoop

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Help with Dialog ActionLoop

Post by gchichester » Thu Mar 05, 2009 8:48 pm

I'm getting strange effect (can’t fill in a edit field ) while completing the dialog once my If statement is true.
I believe it’s because of this If statement "If>BoLDialog.DDate>1,Update"
Once a date is entered into DDate it will always be >1 and the “ActionLoopâ€

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Mar 05, 2009 9:21 pm

I would do something like test for a length of the date. Assuming the date is always 10 characters eg. 03/05/2009. You need to do something to prevent the script from jumping to Update before all the characters get typed in.

Also create a flag variable in this case its "UpdateFlag") that gets set to a value preventing the if statement from executing each and every loop cycle after the date has been typed in.

Code: Select all

Dialog>BoLDialog
  Caption=Bill of Lading Info
  Left=430
  Top=100
  Width=340
  Height=500
 Label=Shipper Name:,10,20
 Edit=ShpName,100,20,120,
 Label=Booking Number:,10,45
 Edit=BkNum,100,45,120,
 Label=Bill of Lading #:,10,70
 Edit=BoLNum,100,70,120,
 Label=Reference:,10,95
 Edit=RefNum,100,95,120,
 Label=Carrier Code :,10,120
 Edit=SLCode,100,120,120,
 Label=Departure Date:,10,145
 Edit=DDate,100,145,120,
 Label=Loading Port:,10,170
 Edit=LPort,100,170,120,
 Label=Port of Discharge:,10,195
 Edit=DPort,100,195,120,
 Label=Vessel Name:,10,220
 Edit=VName,100,220,120,
 Label=Container #:,10,245
 Edit=ContNum,100,245,120,
 //Label= Num of Containers:,225,230
 //Edit=NumOfCont,250,245,40,
 Label=Seal Number:,10,270
 Edit=SNum,100,270,120,
 Label=Quantity:,10,295
 Edit=CtnQty,100,295,120,
 Label=Weight:,10,320
 Edit=ContWgt,100,320,120,
 Label=Service Contract:,10,345
 Edit=SrvContract,100,345,120,
 Label=Temp:,10,370
 Edit=Temp,100,370,120,
 Label=Vents:,10,395
 Edit=Vents,100,395,120,
 Label=Total Cartons:,10,420
 Edit=Cartons,100,420,120,
 Button=Done,10,445,75,20,6
 Button=Update,216,445,75,20,1
EndDialog>BoLDialog

Show>BoLDialog

Let>UpdateFlag=1

Label>ActionLoop
    GetDialogAction>BoLDialog,r
    If>{(%BoLDialog.ShpName% = "SCOTT") AND (%BoLDialog.SLCode% = "MAEU")}
   	Let>SrvContNum=297928
    EndIf

    If>{(%BoLDialog.ShpName% = "SCOTT") AND (%BoLDialog.SLCode% = "APLU")}
   	Let>SrvContNum=GB08/0280
    EndIf
    Length>BoLDialog.DDate,vLen
    If>{(%vlen%=10)and(%UpdateFlag%=1)},Update
    If>r=1,Update
    If>r=6,Close
    If>r=2,Exit
GoTo>ActionLoop
Label>Exit

SRT>Update
  Let>UpdateFlag=0
  Let>BoLDialog.SrvContract=%SrvContNum%
  ResetDialogAction>BoLDialog
END>Update

SRT>Close
  CloseDialog>BoLDialog
  Let>r=2
END>Close

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Help with Dialog ActionLoop

Post by gchichester » Fri Mar 06, 2009 8:29 pm

JRL, The modifications you suggested worked well for my Dialog.
But when I included it in my script, I'm getting more strange anomalies.
Because this script runs ontop of another program, running it in
debug mode is flaky. So I turned on logging looking for problems and
found a log file with 142887 lines in it. I included a sample from the
log. It seems that 90% it a repeat of the samething, not sure if this is a issue or not.
The real issue is when the Dialog is closed and my script
continues it works up to Alt-u (see end of log file) and will not process the Alt-r for some reason.
I put a waitkeydown to help see what was happening and I noticed sendkey action right after the
Alt-u thats not in my script.
Also I added the message> to verify my dialog input
Have any clues?

Code: Select all

Let>IGNORESPACES=1
//Let>WW_TIMEOUT=5
Step_Delay=300
Let>vWait=0.45
Let>SW=0.15
CapsOn
Dialog>BoLDialog
  Caption=Bill of Lading Info
  Left=430
  Top=100
  Width=340
  Height=500
 Label=Shipper Name:,10,20
 Edit=ShpName,100,20,120,
 Label=Booking Number:,10,45
 Edit=BkNum,100,45,120,
 Label=Bill of Lading #:,10,70
 Edit=BoLNum,100,70,120,
 Label=Reference:,10,95
 Edit=RefNum,100,95,120,
 Label=Carrier Code :,10,120
 Edit=SLCode,100,120,120,
 Label=Departure Date:,10,145
 Edit=DDate,100,145,120,
 Label=Loading Port:,10,170
 Edit=LPort,100,170,120,
 Label=Port of Discharge:,10,195
 Edit=DPort,100,195,120,
 Label=Vessel Name:,10,220
 Edit=VName,100,220,120,
 Label=Container #:,10,245
 Edit=ContNum,100,245,120,
 //Label= Num of Containers:,225,230
 //Edit=NumOfCont,250,245,40,
 Label=Seal Number:,10,270
 Edit=SNum,100,270,120,
 Label=Quantity:,10,295
 Edit=CtnQty,100,295,120,
 Label=Weight:,10,320
 Edit=ContWgt,100,320,120,
 Label=Service Contract:,10,345
 Edit=SrvContract,100,345,120,
 Label=Temp:,10,370
 Edit=Temp,100,370,120,
 Label=Vents:,10,395
 Edit=Vents,100,395,120,
 Label=Total Cartons:,10,420
 Edit=Cartons,100,420,120,
 Button=Done,10,445,75,20,2
 Button=Update,216,445,75,20,1
EndDialog>BoLDialog
Show>BoLDialog
Include>c:\CP_Macros\NewEuropeJohn\DialogAction.scp


Sample from log file
3/6/2009 13:53:13:656 - Started Macro : 1_NewBoL
3/6/2009 13:53:13:656 - /*
3/6/2009 13:53:13:656 - Let>IGNORESPACES=1
3/6/2009 13:53:13:656 - //Let>WW_TIMEOUT=5
3/6/2009 13:53:13:656 - Step_Delay=300
3/6/2009 13:53:13:656 - Let>vWait=0.45
3/6/2009 13:53:13:671 - Let>SW=0.15
3/6/2009 13:53:13:671 - CapsOn
3/6/2009 13:53:13:671 - Dialog>BoLDialog
3/6/2009 13:53:13:703 - Show>BoLDialog
3/6/2009 13:53:13:734 - Include>c:\CP_Macros\NewEuropeJohn\DialogAction.scp
3/6/2009 13:53:13:734 - Step_Delay=200
3/6/2009 13:53:13:734 - Let>UpdateFlag=1
3/6/2009 13:53:13:734 - Label>ActionLoop
3/6/2009 13:53:13:734 - GetDialogAction>BoLDialog,r
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DIVERSIFIED") AND ( = "APLU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DIVERSIFIED") AND ( = "HJSC")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DIVERSIFIED") AND ( = "MAEU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - //------------------------------------------------------------------------------DLF
3/6/2009 13:53:13:734 - If>{( = "DLF") AND ( = "APLU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DLF") AND ( = "HJSC")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DLF") AND ( = "MAEU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - //------------------------------------------------------------------------------DNE
3/6/2009 13:53:13:734 - If>{( = "DNE") AND ( = "APLU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DNE") AND ( = "CMDU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DNE") AND ( = "ELGV")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DNE") AND ( = "HJSC")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DNE") AND ( = "HLCU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DNE") AND ( = "MAEU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - If>{( = "DNE") AND ( = "OOLU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - //------------------------------------------------------------------------------DUDA
3/6/2009 13:53:13:734 - If>{( = "DUDA") AND ( = "APLU")}
3/6/2009 13:53:13:734 - 
3/6/2009 13:53:13:734 - //------------------------------------------------------------------------------GREENE RIVER
3/6/2009 13:53:13:750 - If>{( = "GREENE RIVER") AND ( = "APLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "GREENE RIVER") AND ( = "CMDU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "GREENE RIVER") AND ( = "HJSC")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "GREENE RIVER") AND ( = "HLCU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "GREENE RIVER") AND ( = "MAEU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------HELLER
3/6/2009 13:53:13:750 - If>{( = "HELLER") AND ( = "MAEU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------LEROY SMITH
3/6/2009 13:53:13:750 - If>{( = "LEROY") AND ( = "HJSC")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "LEROY") AND ( = "HLCU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "LEROY") AND ( = "MAEU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------PACKERS
3/6/2009 13:53:13:750 - If>{( = "PACKERS") AND ( = "APLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "PACKERS") AND ( = "HJSC")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "PACKERS") AND ( = "MAEU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "PACKERS") AND ( = "OOLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------PIONEER
3/6/2009 13:53:13:750 - If>{( = "PIONEER") AND ( = "APLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------PREMIER
3/6/2009 13:53:13:750 - If>{( = "PREMIER") AND ( = "APLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "PREMIER") AND ( = "CMDU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "PREMIER") AND ( = "HJSC")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "PREMIER") AND ( = "HLCU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "PREMIER") AND ( = "MAEU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------RIVER ONE
3/6/2009 13:53:13:750 - If>{( = "RIVER ONE") AND ( = "APLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------SCOTT
3/6/2009 13:53:13:750 - If>{( = "SCOTT") AND ( = "APLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "SCOTT") AND ( = "HJSC")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "SCOTT") AND ( = "HLCU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - If>{( = "SCOTT") AND ( = "MAEU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:750 - //------------------------------------------------------------------------------SEALD-SWEET
3/6/2009 13:53:13:750 - If>{( = "SEALD SWEET") AND ( = "APLU")}
3/6/2009 13:53:13:750 - 
3/6/2009 13:53:13:765 - If>{( = "SEALD SWEET") AND ( = "HJSU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "SEALD SWEET") AND ( = "HLCU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "SEALD SWEET") AND ( = "MAEU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - //------------------------------------------------------------------------------SUNNY FRESH
3/6/2009 13:53:13:765 - If>{( = "SUNNY FRESH") AND ( = "APLU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - Length>BoLDialog.DDate,vLen
3/6/2009 13:53:13:765 - If>{(0=6)and(1=1)},Update
3/6/2009 13:53:13:765 - If>r=1,Update
3/6/2009 13:53:13:765 - If>r=2,End
3/6/2009 13:53:13:765 - GoTo>ActionLoop
3/6/2009 13:53:13:765 - GetDialogAction>BoLDialog,r
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DIVERSIFIED") AND ( = "APLU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DIVERSIFIED") AND ( = "HJSC")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DIVERSIFIED") AND ( = "MAEU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - //------------------------------------------------------------------------------DLF
3/6/2009 13:53:13:765 - If>{( = "DLF") AND ( = "APLU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DLF") AND ( = "HJSC")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DLF") AND ( = "MAEU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - //------------------------------------------------------------------------------DNE
3/6/2009 13:53:13:765 - If>{( = "DNE") AND ( = "APLU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DNE") AND ( = "CMDU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DNE") AND ( = "ELGV")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DNE") AND ( = "HJSC")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DNE") AND ( = "HLCU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DNE") AND ( = "MAEU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "DNE") AND ( = "OOLU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - //------------------------------------------------------------------------------DUDA
3/6/2009 13:53:13:765 - If>{( = "DUDA") AND ( = "APLU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - //------------------------------------------------------------------------------GREENE RIVER
3/6/2009 13:53:13:765 - If>{( = "GREENE RIVER") AND ( = "APLU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "GREENE RIVER") AND ( = "CMDU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "GREENE RIVER") AND ( = "HJSC")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:765 - If>{( = "GREENE RIVER") AND ( = "HLCU")}
3/6/2009 13:53:13:765 - 
3/6/2009 13:53:13:781 - If>{( = "GREENE RIVER") AND ( = "MAEU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------HELLER
3/6/2009 13:53:13:781 - If>{( = "HELLER") AND ( = "MAEU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------LEROY SMITH
3/6/2009 13:53:13:781 - If>{( = "LEROY") AND ( = "HJSC")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "LEROY") AND ( = "HLCU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "LEROY") AND ( = "MAEU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------PACKERS
3/6/2009 13:53:13:781 - If>{( = "PACKERS") AND ( = "APLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "PACKERS") AND ( = "HJSC")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "PACKERS") AND ( = "MAEU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "PACKERS") AND ( = "OOLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------PIONEER
3/6/2009 13:53:13:781 - If>{( = "PIONEER") AND ( = "APLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------PREMIER
3/6/2009 13:53:13:781 - If>{( = "PREMIER") AND ( = "APLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "PREMIER") AND ( = "CMDU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "PREMIER") AND ( = "HJSC")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "PREMIER") AND ( = "HLCU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "PREMIER") AND ( = "MAEU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------RIVER ONE
3/6/2009 13:53:13:781 - If>{( = "RIVER ONE") AND ( = "APLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------SCOTT
3/6/2009 13:53:13:781 - If>{( = "SCOTT") AND ( = "APLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "SCOTT") AND ( = "HJSC")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "SCOTT") AND ( = "HLCU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "SCOTT") AND ( = "MAEU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------SEALD-SWEET
3/6/2009 13:53:13:781 - If>{( = "SEALD SWEET") AND ( = "APLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "SEALD SWEET") AND ( = "HJSU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "SEALD SWEET") AND ( = "HLCU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - If>{( = "SEALD SWEET") AND ( = "MAEU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - //------------------------------------------------------------------------------SUNNY FRESH
3/6/2009 13:53:13:781 - If>{( = "SUNNY FRESH") AND ( = "APLU")}
3/6/2009 13:53:13:781 - 
3/6/2009 13:53:13:781 - Length>BoLDialog.DDate,vLen
3/6/2009 13:53:13:781 - If>{(0=6)and(1=1)},Update
3/6/2009 13:53:13:796 - If>r=1,Update
3/6/2009 13:53:13:796 - If>r=2,End
3/6/2009 13:53:13:796 - GoTo>ActionLoop
3/6/2009 13:53:13:796 - GetDialogAction>BoLDialog,r
--
3/6/2009 13:53:56:343 - Length>BoLDialog.DDate,vLen
3/6/2009 13:53:56:343 - If>{(6=6)and(0=1)},Update
3/6/2009 13:53:56:343 - If>r=1,Update
3/6/2009 13:53:56:343 - If>r=2,End
3/6/2009 13:53:56:343 - GoTo>ActionLoop
3/6/2009 13:53:56:343 - GetDialogAction>BoLDialog,r
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DIVERSIFIED") AND (APLU = "APLU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DIVERSIFIED") AND (APLU = "HJSC")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DIVERSIFIED") AND (APLU = "MAEU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - //------------------------------------------------------------------------------DLF
3/6/2009 13:53:56:343 - If>{(DLF = "DLF") AND (APLU = "APLU")}
3/6/2009 13:53:56:343 - Let>SrvContNum=GB08/0285
3/6/2009 13:53:56:343 - EndIf
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DLF") AND (APLU = "HJSC")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DLF") AND (APLU = "MAEU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - //------------------------------------------------------------------------------DNE
3/6/2009 13:53:56:343 - If>{(DLF = "DNE") AND (APLU = "APLU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DNE") AND (APLU = "CMDU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DNE") AND (APLU = "ELGV")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DNE") AND (APLU = "HJSC")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DNE") AND (APLU = "HLCU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DNE") AND (APLU = "MAEU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "DNE") AND (APLU = "OOLU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - //------------------------------------------------------------------------------DUDA
3/6/2009 13:53:56:343 - If>{(DLF = "DUDA") AND (APLU = "APLU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - //------------------------------------------------------------------------------GREENE RIVER
3/6/2009 13:53:56:343 - If>{(DLF = "GREENE RIVER") AND (APLU = "APLU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "GREENE RIVER") AND (APLU = "CMDU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "GREENE RIVER") AND (APLU = "HJSC")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "GREENE RIVER") AND (APLU = "HLCU")}
3/6/2009 13:53:56:343 - 
3/6/2009 13:53:56:343 - If>{(DLF = "GREENE RIVER") AND (APLU = "MAEU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------HELLER
3/6/2009 13:53:56:359 - If>{(DLF = "HELLER") AND (APLU = "MAEU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------LEROY SMITH
3/6/2009 13:53:56:359 - If>{(DLF = "LEROY") AND (APLU = "HJSC")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "LEROY") AND (APLU = "HLCU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "LEROY") AND (APLU = "MAEU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------PACKERS
3/6/2009 13:53:56:359 - If>{(DLF = "PACKERS") AND (APLU = "APLU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "PACKERS") AND (APLU = "HJSC")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "PACKERS") AND (APLU = "MAEU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "PACKERS") AND (APLU = "OOLU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------PIONEER
3/6/2009 13:53:56:359 - If>{(DLF = "PIONEER") AND (APLU = "APLU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------PREMIER
3/6/2009 13:53:56:359 - If>{(DLF = "PREMIER") AND (APLU = "APLU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "PREMIER") AND (APLU = "CMDU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "PREMIER") AND (APLU = "HJSC")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "PREMIER") AND (APLU = "HLCU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "PREMIER") AND (APLU = "MAEU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------RIVER ONE
3/6/2009 13:53:56:359 - If>{(DLF = "RIVER ONE") AND (APLU = "APLU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------SCOTT
3/6/2009 13:53:56:359 - If>{(DLF = "SCOTT") AND (APLU = "APLU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "SCOTT") AND (APLU = "HJSC")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "SCOTT") AND (APLU = "HLCU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "SCOTT") AND (APLU = "MAEU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - //------------------------------------------------------------------------------SEALD-SWEET
3/6/2009 13:53:56:359 - If>{(DLF = "SEALD SWEET") AND (APLU = "APLU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "SEALD SWEET") AND (APLU = "HJSU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:359 - If>{(DLF = "SEALD SWEET") AND (APLU = "HLCU")}
3/6/2009 13:53:56:359 - 
3/6/2009 13:53:56:375 - If>{(DLF = "SEALD SWEET") AND (APLU = "MAEU")}
3/6/2009 13:53:56:375 - 
3/6/2009 13:53:56:375 - //------------------------------------------------------------------------------SUNNY FRESH
3/6/2009 13:53:56:375 - If>{(DLF = "SUNNY FRESH") AND (APLU = "APLU")}
3/6/2009 13:53:56:375 - 
3/6/2009 13:53:56:375 - Length>BoLDialog.DDate,vLen
3/6/2009 13:53:56:375 - If>{(6=6)and(0=1)},Update
3/6/2009 13:53:56:375 - If>r=1,Update
3/6/2009 13:53:56:375 - If>r=2,End
3/6/2009 13:53:56:375 - 
3/6/2009 13:53:56:375 - SRT>Update
3/6/2009 13:53:56:375 - 
3/6/2009 13:53:56:375 - SRT>End
3/6/2009 13:53:56:375 - 
3/6/2009 13:53:56:375 - Wait>0.30
3/6/2009 13:53:56:687 - SetFocus>Open/New Shipment*
3/6/2009 13:53:56:687 - Wait>0.30
3/6/2009 13:53:57:000 - 
3/6/2009 13:53:57:000 - //Message>DLF,WLK90001,WLK90001,WLK90002,APLU,030909,5201,58840,MAERSK,APLU 1001001,A10001,1260,50400,GB08/0285,44,25
3/6/2009 13:53:57:000 - 
3/6/2009 13:53:57:000 - /*
3/6/2009 13:53:57:000 - Press ALT
3/6/2009 13:53:57:015 - Send>2
3/6/2009 13:53:57:015 - Release Alt
3/6/2009 13:53:57:015 - 
3/6/2009 13:53:57:015 - /*
3/6/2009 13:53:57:015 - Wait>SW
3/6/2009 13:53:57:171 - Press Shift
3/6/2009 13:53:57:187 - Press Tab
3/6/2009 13:53:57:203 - Wait>SW
3/6/2009 13:53:57:359 - Press Tab
3/6/2009 13:53:57:375 - Wait>SW
3/6/2009 13:53:57:531 - Release Shift
3/6/2009 13:53:57:531 - Wait>SW
3/6/2009 13:53:57:687 - Press Down * 2
3/6/2009 13:53:57:718 - Wait>vWait
3/6/2009 13:53:58:171 - 
3/6/2009 13:53:58:171 - /*
3/6/2009 13:53:58:171 - Press ALT
3/6/2009 13:53:58:187 - Send>u
3/6/2009 13:53:58:187 - Release ALT
3/6/2009 13:53:58:187 - Wait>vWait
3/6/2009 13:53:58:640 - 
3/6/2009 13:53:58:640 - /*
3/6/2009 13:53:58:640 - Press ALT
3/6/2009 13:53:58:656 - Send>r
3/6/2009 13:53:58:656 - Release ALT
3/6/2009 13:53:58:656 - WaitKeyDown>VK123
3/6/2009 13:54:20:328 - Finished Macro : 1_NewBoL

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Mar 06, 2009 10:23 pm

So I turned on logging looking for problems and
found a log file with 142887 lines in it.
Yes you have a tight loop that will generate repeat logfile entries as fast as your computer can write them. There is a relatively new system variable that can be used to turn logging on and off.
Help wrote:_WRITE_LOG_FILE
Set to 0 to temporarily disable logging. Set to 1 to enable
Let>_WRITE_LOG_FILE=1
//script you want logged
Let>_WRITE_LOG_FILE=0
//Script you don't want logged
it works up to Alt-u (see end of log file) and will not process the Alt-r for some reason.
The log looks like it logged the Alt+r being processed. Are you saying that it did not do what it should have done in the other app? perhaps you lost focus on the window you want the Alt+r to run in.
I put a waitkeydown to help see what was happening and I noticed sendkey action right after the
Alt-u thats not in my script.
Below is the end of your log file. I don't see any sendkey action after the Alt+u except for the Alt+r just discussed.

All that said. I see a bunch of "start remark blocks" at the end of the logfile. Remember, if you have code remarked out, it won't process.
3/6/2009 13:53:58:171 -
3/6/2009 13:53:58:171 - /*
3/6/2009 13:53:58:171 - Press ALT
3/6/2009 13:53:58:187 - Send>u
3/6/2009 13:53:58:187 - Release ALT
3/6/2009 13:53:58:187 - Wait>vWait
3/6/2009 13:53:58:640 -
3/6/2009 13:53:58:640 - /*
3/6/2009 13:53:58:640 - Press ALT
3/6/2009 13:53:58:656 - Send>r
3/6/2009 13:53:58:656 - Release ALT
3/6/2009 13:53:58:656 - WaitKeyDown>VK123
3/6/2009 13:54:20:328 - Finished Macro : 1_NewBoL

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Post by gchichester » Mon Mar 09, 2009 1:17 pm

Yes you have a tight loop that will generate repeat logfile entries as fast as your computer can write them. There is a relatively new system variable that can be used to turn logging on and off.
JRL,
Thanks for the info about the size of my log file and the tip about the new system variable for logging. That will help in the future.
The log looks like it logged the Alt+r being processed.
Are you saying that it did not do what it should have done in the other app?
perhaps you lost focus on the window you want the Alt+r to run in.
Yes it does appear that way in the log file, that’s what doesn’t makes sense. I can see the Alt+u action, and the Alt+r should happen on the same screen so I don’t see how there could be a “loss of focusâ€

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Mar 09, 2009 1:54 pm

Gil,
I've looked at all you've posted and your video. I applaud your attempt to be thourough.

I was scanning your script for the possibility that "r" is a variable and has been set to something. Found it!

GetDialogAction>BoLDialog,r

Since r has been set to a number you are actually sending the number and not an "r" in the lines.

Press ALT
send>r
Release ALT


Don't use single characters as variables. It WILL eventually bite you.

sorry I didn't notice this the first time.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Mar 09, 2009 2:44 pm

Or do the following to always send the literal "r":

Press ALT
Send>{"r"}
Release ALT
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Mar 09, 2009 3:22 pm

JRL wrote:Don't use single characters as variables. It WILL eventually bite you.
Very true... I learned this the hard way too... and what happened here is the perfect example of how easy it can happen.

Even though this has been mentioned many times here on the forums... this keeps happening to new users and will no doubt continue... but here's an idea that might help new users get into better coding habits early:
  • a list of "Best Coding Practices" could be compiled
  • the list could be made available in a permanent post here on the forums and new users encouraged to read it
  • the list could also be shown in the Help File... in the sections where a user first learns to write a script
  • alternatively, the Help File could just have a link to the posted "Best Coding Practices" list here on the forums
  • users could make suggestions for additions to the list
  • Marcus could review the suggestions for possible addition to the list
  • I think a list of "Best Posting Practices" would also be very helpful for new users on the forum... to help them post code correctly, search for an answer themselves first before posting a question, etc.
Just my two cents... take care.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Mar 09, 2009 3:24 pm

Marcus wrote:Send>{"r"}
My first thought was, "How were any of us users supposed to know we could do that?" I was mistakenly under the impression that complex expression were only workable in If> and Let> functions.

Then I read:
Help for Complex Expressions -> Strings wrote:Complex expressions are supported in Macro Scheduler's IF statements and LET statement, and since version 9.0 can now also be included within all other commands and function calls in the place of regular variables.
It pays to re-read help every now and then.

Marcus, thank you for the heads up.

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Post by gchichester » Mon Mar 09, 2009 6:49 pm

Thanks JRL,
No problem I’m sure you look at a lot of code, and our instincts were correct, after changing the variable my script is working as it should. And also for the tip Also for.

Thanks Marcus,
I will start using literals for all my hotkey actions, It’s a little more coding but should prevent issues in the future.


And Thanks to jpuziano for your great idea, a "Best Coding Practices" documnet.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts