I need some help with creating two Dialogs.
The First one will allow the user to Select and Input File (I've read about the FileBrowse option, but can't seem to understand it and I've tried searching the forums, but I'm not having any luck).
The Second one, will be a progress display. My Source File will contain about 10000 Records and as my Macro progresses through the file, I'd like to show a status display on screen in a Dialog Box. I want this Dialog box to contain the current record that is being processed as well as data retrieved from the Web Site that is being written to the Output file. My Source File is a CSV File and is there an easy way to get the total number of records in the file before processing without having to take the extra time to do a For Loop setting a value to the number of records read? Maybe the whole file could be retrieved and the number of lines counted pretty easily (not sure and need some help on this).
I'm sure that through my process, I have to call a certain location to display the Dialog Box on Screen with the updated information.
Any Links, Help, Pointers would be greatly appreciated on this problem.
Thank You.
Dialog Help
Moderators: JRL, Dorian (MJT support)
One way to do this is here:is there an easy way to get the total number of records in the file before processing without having to take the extra time to do a For Loop setting a value to the number of records read?
http://www.mjtnet.com/forum/viewtopic.php?t=3069
Here's a snippet of code to do a filebrowse dialog and then put the contents of the selected file to a variable named "filedata"The First one will allow the user to Select and Input File
Code: Select all
Dialog>Dialog1
Caption=Select
Width=817
Height=133
Top=CENTER
Left=CENTER
Label=msLabel1,16,16
Edit=msEdit1,8,32,713,
Button=Ok,360,64,75,25,3
Button=Browse,728,32,75,25,0
FileBrowse=Browse,msEdit1,CSV files|*.CSV,open
EndDialog>Dialog1
Show>dialog1,res1
ReadFile>dialog1.msEdit1,filedata
Here is a extension of the previous snippet that will display the line number of the csv file being "processed" and the first field information on the processed line. also notice that the value of variable record_count will be another way to see the total number of lines in the file.The Second one, will be a progress display. My Source File will contain about 10000 Records and as my Macro progresses through the file, I'd like to show a status display on screen in a Dialog Box
Code: Select all
Dialog>Dialog1
Caption=Select
Width=817
Height=133
Top=CENTER
Left=CENTER
Label=msLabel1,16,16
Edit=msEdit1,8,32,713,
Button=Ok,360,64,75,25,3
Button=Browse,728,32,75,25,0
FileBrowse=Browse,msEdit1,CSV files|*.CSV,open
EndDialog>Dialog1
Show>dialog1,res1
Dialog>Dialog3
Caption=Process Status
Width=348
Height=119
Top=203
Left=314
Label=Line Number:,48,24
Label=msLabel2,120,24
Label=Data Read:,48,48
Label=msLabel4,120,48
EndDialog>Dialog3
Show>dialog3
ReadFile>dialog1.msEdit1,filedata
Separate>filedata,%CRLF%,record
Let>comma=,
Let>kk=0
Repeat>kk
GetDialogAction>dialog3,res3
If>res3=2,EOF
Add>kk,1
Let>value=record_%kk%
Separate>value,comma,field
Let>dialog3.mslabel2=%kk%
Let>dialog3.mslabel4=%field_1%
Wait>0.01
Until>kk,%record_count%
Label>EOF