Search the Community
Showing results for tags 'saving'.
-
Hello, I've been working on a program where a GUI with an input box and run button. User can enter in a 7 digit code and it will open up a file directory. The user can open up another GUI which enables them to save there own codes with an associated directory. This is done with a 2D array, where there is a column for the code, and a column for the file directory, there is also a column where user could enter in the path to a .exe file if they wanted to open a file instead of just the folder directory. Example of how the array could look: ;Savedcodes array columns[Codes][Address][EXE] #include <Array.au3> initiallist() Func initiallist();Initialization of array Global $savedcodes[1][2] ; Array for saving user entered commands $code = 0 $address = 1 ;Default codes $savedcodes[UBound($savedcodes)-1][$code] = "ggggggg";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "G:\" _ArrayAdd($savedcodes, "") $savedcodes[UBound($savedcodes)-1][$code] = "ddddddd";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "D:\" _ArrayAdd($savedcodes, "") $savedcodes[UBound($savedcodes)-1][$code] = "ccccccc";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "C:\" _ArrayAdd($savedcodes, "") $savedcodes[UBound($savedcodes)-1][$code] = "hhhhhhh";###Initialization### $savedcodes[UBound($savedcodes)-1][$address] = "H:\" _ArrayDisplay($savedcodes) EndFunc Anyways everything runs pretty smoothly, however I am not sure how to save this array so that if the user was to close the program that they could use the codes they had entered in previously, without having to re-enter them in each time they open it. Any ideas on how best to achieve this? Users will not have administrative rights. The only way I can think of how to achieve this goal is by writing to the file, which I'd be totally happy doing. However I wouldn't know how to delete old lines that exist. I have a function already, that is able to read through a file and look for specific markers (say: ###Initialization###) and return that line number. If the marker was detected I could delete that line, and then add new lines for every element of array using the _FileWriteToLine(). Any idea if there is a function instead of writing to a specific line it would delete it?
-
Having migrated my PC across to W10, I am getting an odd behaviour when executing a script that works perfectly under W7... Wondered if anyone else had come across this: So, my script runs an external program called Deep Sky Planner. It opens two reports to calculate positions in the night sky for each of the 8 planets, plus the Moon and Sun. It then saves each of these reports as a HTML file, and a PDF file. I upload these to my astronomical societies web-site. One report is a set of basic data, then a more detailed one is run. Each report is named with the month-year-object, so 1015Venus.html or 1015Sun_det.pdf Under W7 (64bit), no problem. On my W10 machine, the change of the filename to be saved is not recognised by the 'Save As' dialogue box, even though the new file name is clearly there in the text edit box! So, I get an error saying that the file already exists! I've attached a picture of the dialog box error so you can see what I mean. I've also attached my code (feel free to rip this apart ) Has anyone else seen this? Any suggestions?? Thanks Daz DSP_This_Month.au3
- 3 replies
-
- scite
- windows 10
-
(and 1 more)
Tagged with: