NELyon Posted June 23, 2006 Share Posted June 23, 2006 Heres what i am trying to get. Is it possible to display the file in variable $input_whatev (say that variable is whatev.txt) is it possible to display whatev.txt in a GUI edit box? The edit box's variable being $edit_1? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 23, 2006 Share Posted June 23, 2006 Guictrlsetdata($edit_1,Fileread("whatev.txt")) Link to comment Share on other sites More sharing options...
NELyon Posted June 23, 2006 Author Share Posted June 23, 2006 oh, i read about fileread and i thought it just returned the number of characters in the file Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 23, 2006 Share Posted June 23, 2006 on every topic there is the section called Return Value Return Value Success: Returns the binary/string read. always good to look at Link to comment Share on other sites More sharing options...
Skruge Posted June 23, 2006 Share Posted June 23, 2006 Adding a load option to your editor? $sInFile = FileOpenDialog("Select a file to open",@UserProfileDir, "All Files (*.*)") $sFileText = Fileread($sInFile) ; ... GUICtrlSetData($Edit1, $sFileText) [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 23, 2006 Share Posted June 23, 2006 whose uses variables for such a thing GUICtrlSetData($Edit_1,Fileread(FileOpenDialog("Select a file to open",@UserProfileDir, "All Files (*.*)"))) just letting people know you can pop functions inside functions , itll execute the inside ones first . Its ok they dont bite or like crush each other or like idk what Link to comment Share on other sites More sharing options...
Skruge Posted June 23, 2006 Share Posted June 23, 2006 just letting people know you can pop functions inside functionsTrue, but what about error checking? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 23, 2006 Share Posted June 23, 2006 you dont need variables for error checking Link to comment Share on other sites More sharing options...
Skruge Posted June 24, 2006 Share Posted June 24, 2006 Trust me, I agree with you there and I'm not arguing with you. I write complex 1-line batch files all the time. It looks like codemyster is working on his editor program, so he might want to re-use that info. (for example, to see if the user is re-opening the same file) [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 24, 2006 Share Posted June 24, 2006 you can still avoid it, first you do an Iniwrite of the file and simply do an iniread eh yeah gotcha there lol im done Link to comment Share on other sites More sharing options...
Skruge Posted June 24, 2006 Share Posted June 24, 2006 Who uses files for such a thing? Have a great weekend! lol [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
NELyon Posted June 24, 2006 Author Share Posted June 24, 2006 (edited) Skrunge (and thatsgreat): thats what i was trying to do at first but i wasn't sure on the fileopendialog stuff. EDIT: ok, i tried to do the same thing with my save part, but i'm getting an error: FileWrite(GUICtrlRead($Edit_1, Fileread(FilesaveDialog("Select a file to save",@ScriptDir, "All Files (*.*)"))) Edited June 24, 2006 by codemyster Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 24, 2006 Share Posted June 24, 2006 heheh cuz you got it completely mixed up, filesavedialog should go first since it returns the file handle and thats what the first paramater in filewrite is, then should come the Guictrlread and , and you dont need the Fileread FileWrite(FilesaveDialog("Select a file to save",@ScriptDir, "All Files (*.*)"),GUICtrlRead($Edit_1)) Link to comment Share on other sites More sharing options...
NELyon Posted June 24, 2006 Author Share Posted June 24, 2006 ok, the update is done, check out the link in my sig 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