View Single Post
  #3 (permalink)  
Old 06-10-2008, 09:23 AM
Maprwz Maprwz is offline
Junior Member
 
Join Date: Jun 2008
Posts: 14
Default Here is the code

I do not receive an error. Perhaps the Start Loop is working but some of the other statements are not working. Why do I think this? Because when I run this version in Debug mode:
  • it shows me EVERY line highlighted in yellow regardless of whether the IF was true or false or whether the Loop was to be executed or not
  • the Message Box does not appear
  • the Copy Files does not copy
  • but the "Open File" of the BAT file works
  • and the "Delete Files" of the BAT file
Ah! Does the "Copy Files" command overwrite an existing file? Or do I have to delete the previous file before copying the new one?

----------------------------------------------------------
1 Variable Operation : True To $FOREVER$
2 Loop While $FOREVER$ Equal To "True"
3 Start Loop " Each File in C:\Wrappers\AutoAnywhere\BatFiles"
4 Message Box: "[$FileName$]"
5 Variable Operation : 0 To $GOTBAT$
6 If $Extension$ Equal To "BAT" Then
7 Variable Operation : 1 To $GOTBAT$
8 End If
9 If $Extension$ Equal To "bat" Then
10 Variable Operation : 1 To $GOTBAT$
11 End If
12 If $GOTBAT$ Equal To "1" Then
13 Copy Files "$CurrentDirectory$\$FileName$.$Extension$" to "C:\Wrapper\AutoAnywhere\BatFiles\CobolName.tx t"
14 Delay: (100 ms)
15 Open File "$CurrentDirectory$\$FileName$.$Extension$"
16 Variable Operation : 0 To $ENDJOB$
17 Comment: COBJOB is a list of COBOL.EXE's read from the .txt file
18 Start Loop " List Variable COBJOB"
19 Variable Operation : $COBJOB$ To $CobolName$
20 Variable Operation : 0 To $ENDPROG$
21 Loop While $ENDPROG$ Equal To "0"
22 Delay: (100 ms)
23 If Application Not Running ("$CobolName$") Then
24 Variable Operation : 1 To $ENDPROG$
25 End If
26 If Application Running ("F3BKDSNP.exe") Then
27 Variable Operation : 1 To $Popup$
28 Loop While $Popup$ Equal To "1"
29 Activate Window: "COBOL*"
30 Get Text from Window : "COBOL*" Assign to variable "$WindowText$"
31 If $WindowText$ Includes "Do you want to open the report file" Then
32 Click On Command Button : "No" in Window : "COBOL ERROR REPORT"
33 Variable Operation : 0 To $Popup$
34 Variable Operation : 1 To $ENDJOB$
35 Variable Operation : 1 To $ENDPROG$
36 Else
37 Click On Command Button : "OK" in Window : "COBOL"
38 End If
39 End Loop
40 End If
41 End Loop
42 If $ENDJOB$ Equal To "1" Then
43 Exit Loop
44 End If
45 End Loop
46 Delete Files "$CurrentDirectory$\$FileName$.$Extension$"
47 End If
48 End Loop
49 End Loop
Reply With Quote