New "bug"
Richard Kreiss
rkreiss at gccconsulting.net
Wed Jan 16 12:17:12 PST 2008
Windows 5.6.06
As mentioned in an earlier post, I created an import program for csv files.
I initially wrote this as an output process but later, for testing, modified it slightly and ran it from clerk.
Same functionality. At @once the program reads the directory/folder that holds the csv file and loads then into an array. The array is displayed using listbox. The last element of the array is "CANCEL" and not a file name. This gives the user a chance to exit out gracefully.
Now here is the bug.
LABEL D E F I N E P R O C E S S I N G 5.6.06
─────────────────────────────────────────────────────────────────────────────
103 ------- - - - - - - - - - - - - - - - -
◄ If: 'this will place the highlight on the second line of the listbox
Then: sl(1,.0)=listbox(getfile,"1",ct)
104 ------- - - - - - - - - - - - - - - - -
◄ If: @sk = "BRKY"
Then: EXIT "99"
105 ------- - - - - - - - - - - - - - - - -
◄ If: sl = ct
Then: EXIT "99"
106 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: file_name=getfile[sl];CLEARS
107 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: lc=strtok(file_name,"_","1")
108 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: fn=mid(file_name,"1",lc-"1");doc_name="Dr."<fn
At lines 104 and 105 work properly in *clerk. However, in *report the EXIT acts as an END. The process moves to the top of the table and begins processing.
Now the first time this happened and I ran the debugger, I notes the file_name was empty and the program gave me an error that it couldn't find the file.
So, testing at the top of the table to insure file_name was not empty
8 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: dim frecords(1)
9 ------- - - - - - - - - - - - - - - - -
◄ If: done_it = ""
Then: done_it = "1"
10 ------- - - - - - - - - - - - - - - - -
◄ If: done_it ge "2"
Then: EXIT
11 ------- - - - - - - - - - - - - - - - -
◄ If: file_name = ""
Then: EXIT "99"
Added line 11 to the processing.
Again, EXIT acted as an END and processing dropped to @done. At @done the number of records imported is displayed.
Again I had to add a test for file_name
@done ◄ If: '*************************************************************
Then: '* display the number of records posted
170 ------- - - - - - - - - - - - - - - - -
◄ If: file_name = ""
Then: exit "99"
171 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: CLS("1","20")
172 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: msgbox frecords["1"]<"Posted to\n p_import\n For"<doc_name
This time EXIT did end the program, but again acts as an END not an EXIT.
My menu script checks if errorlevel=99 and end the script if it is.
Ray has advised me that this is a bug at least in the Windows version.
Richard Kreiss
GCC Consulting
rkreiss at gccconsulting.net
More information about the Filepro-list
mailing list