Hi all,
I have a file which staff will open in notepad, then add their own line and save. The problem is - they tend to stuff things up. The format of the file is below - it has a header followed by the data. It is a csv but uses a .sb extension.
BASE,100,DRIVERS,100,6,29/08/2002 9:04,29/08/2002 9:04.
Depot number,User number,Name,Balance,Closing Balance,Date,
35464,Priyanka Kumari,0,0,NO DATA,NO DATA,
37165,Laura Hopkinson,0,0,NO DATA, NO DATA,
12942,Vivien Yang,0,0,NO DATA, NO DATA,
What I would like to do - is create an app that would prompt the user for the data, the user would enter the data via a series of message boxes - then it would be written to the file in the above format. this would save allot of headaches and I am sure it wouldnt be too hard? The 2 first parameters need to be entered by staff and the rest can be hard coded.
Any help would be appreciated.
Cheers!
adding lines to a file
Moderators: Dorian (MJT support), JRL
Try something like this. Be sure to assign a proper value to the "filename" variable and make sure to modify the writeln> string and dialog to create what you actually want.
Code: Select all
Let>filename=The path and name of your file
Let>comma=,
Dialog>Dialog1
Caption=Dialog1
Width=433
Height=223
Top=151
Left=26
Button=Save,172,148,75,25,3
Edit=msEdit1,47,42,322,
Edit=msEdit2,49,96,320,
Label=Depot Number,48,24
Label=Name,48,80
Default=Save
EndDialog>Dialog1
Show>Dialog1
Label>Loop
GetDialogAction>Dialog1,res1
If>res1=2
Exit>0
EndIf
If>res1=3
GoSub>Process
EndIf
Wait>0.01
Goto>Loop
SRT>Process
WriteLn>filename,wres,%Dialog1.msedit1%%comma%%Dialog2.msedit1%%comma%0%comma%0%comma%NO DATA%comma%NO DATA
Exit>0
END>Process
thanks mate - exactly what I am after - problem is that as you can see the below 2 lines are not writing the name correctly - I cant see an error so not sure whats happening - any ideas?
13970,Raeoni Jackson,0,0,NO DATA,NO DATA,
32331,%Dialog2.msedit1%,0,0,NO DATA,NO DATA
34234,%Dialog2.msedit1%,0,0,NO DATA,NO DATA
Thanks in advance - appreciate your help
13970,Raeoni Jackson,0,0,NO DATA,NO DATA,
32331,%Dialog2.msedit1%,0,0,NO DATA,NO DATA
34234,%Dialog2.msedit1%,0,0,NO DATA,NO DATA
Thanks in advance - appreciate your help
I'm not much on winter sports. We don't usually get this much snow at once. Its hard to tell for sure because of the drifting but I'm guessing we've gotten a foot of snow in the last 8 hours.
No need to clog the forum with this talk though. If you'd like to discuss the weather you can PM me though I may be too busy shoveling tomorrow to answer
Glad the script worked for you.
No need to clog the forum with this talk though. If you'd like to discuss the weather you can PM me though I may be too busy shoveling tomorrow to answer
Glad the script worked for you.