jennico Posted November 4, 2006 Share Posted November 4, 2006 (edited) hi, when i open an ini by "fileopen", do i have to take care of closing it before the "exit" command ? or does "exit" close all open files automatically ? what happens on @error? is the file released ? the question is because in my program there are several exit events. i want to keep the file open until exit in order to prevent other programs from starting. thanx j. Edited November 4, 2006 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
GaryFrost Posted November 4, 2006 Share Posted November 4, 2006 hi,when i open an ini by "filopen", do i have to take care of closing it before the "exit" command ?or does "exit" close all open files automatically ?what happens on @error? is the file released ?the question is because in my program there are several exit events.thanxj.why would you open an ini with fileopen? why not use the ini functions? SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
MHz Posted November 4, 2006 Share Posted November 4, 2006 Fileclose is automatically done on exit, but you should still do it to make sure. INIRead and INIWrite do not require to use FileOpen else it will probably fail to read/write to the ini file. Link to comment Share on other sites More sharing options...
jennico Posted November 4, 2006 Author Share Posted November 4, 2006 (edited) because its a binary file, not an "ordinary" ini. there are no sections, keys and values. i have to read out the complete string and transform it. on ending of program complete string is exchanged by new data. j. Edited November 4, 2006 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
MHz Posted November 4, 2006 Share Posted November 4, 2006 An INI file is a text file. Link to comment Share on other sites More sharing options...
jennico Posted November 4, 2006 Author Share Posted November 4, 2006 so sorry, maybe its not an ini.file, but its just called "ini". i didnt write that file, so its not my fault. i just alter it. i have oftenly come across "ini" files which contain not only text but pure hex data in one single line. so your right, i shouldnt have called it "ini", but okay, its name is "ini" anyway. thanx anyway, my question is answered. "exit" performs "fileclose" to all opened files. j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
MHz Posted November 4, 2006 Share Posted November 4, 2006 OKThe helpfile does recommend closing closing open files as a good idea before exit. The final choice is yours.RemarksUpon termination, AutoIt automatically closes any files it opened, but calling FileClose is still a good idea. Link to comment Share on other sites More sharing options...
jennico Posted November 4, 2006 Author Share Posted November 4, 2006 OKThe helpfile does recommend closing closing open files as a good idea before exit. The final choice is yours.yep okay, but i dont have to take care of that in case of abnormal program termination ("sideway exits"). good news.j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
Uten Posted November 4, 2006 Share Posted November 4, 2006 We should all do it to enforce good habits. One day you might find yourself using a language witch is not so fault tolerant. Happy coding Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 4, 2006 Moderators Share Posted November 4, 2006 so sorry, maybe its not an ini.file, but its just called "ini". i didnt write that file, so its not my fault. i just alter it.i have oftenly come across "ini" files which contain not only text but pure hex data in one single line. so your right, i shouldnt have called it "ini", but okay, its name is "ini" anyway.thanx anyway, my question is answered. "exit" performs "fileclose" to all opened files.j.Are you sure the ".ini" file isn't just a renamed extension? Are you also sure that it's not encrypted? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now