Re: How to use file_num = open ( "file", "mode" )
- Posted by cense <cense at mail.ru> Aug 12, 2000
- 420 views
On Sat, 12 Aug 2000, jiri babor wrote: > cense just wrote: > > >here try something like this: > > > >-- untested code > > > >include get.e > > > >atom fn > >sequence full_path, drive, file > > > >puts(1, "enter drive letter: ") > >drive = gets(0) -- get the drive letter in a sequence > >puts(1, "enter file name: ") > >file = gets(0) -- get the file name in a sequence > > > >full_path = append( drive, ":\\") -- append the ":\\" to the end of > the drive > >full_path = append( full_path, file ) -- app the file name to the > drive letter > > -- and ":\\" > > > >fn = open( full_path, "w" ) > > -- do your stuff > >close(fn) > > > >hope that helps ( or even works! ) > > > >-- > >cense > > > No, it does not help, because it does not work! > It takes only about 30 seconds to test it, if it works. > If it does not, it usually takes a bit longer, but it saves you a lot > of embarrassment and you do not confuse the poor newbie even more. > > jiri > hey jiri, its no embarassment. At least i was truthful about it not knowing if it worked. sorry for not testing it and all ( i know you *HATE* untested code posters ) but i am running linux at the moments and i still have not bothered to setup euphoria for linux very well yet. > > include get.e > > atom fn > sequence full_path, drive, file > > puts(1, "Enter drive letter: ") > drive = gets(0) -- get the drive letter in a > sequence > drive = drive[1..1] -- strip newline > > puts(1, "\nEnter file name: ") > file = gets(0) -- get the file name in a sequence > file = file[1..length(file)-1] -- strip newline > > full_path = drive & ":\\" & file -- concatenate > > fn = open( full_path, "w" ) > -- do your stuff > close(fn) good work on fixing my crap for code jiri. It been a while since i actually finnished a project in euphoria. sorry Mr newbie that i confused -- cense a member of the ak-software development team http://www.ak-software.com/ contract work for Web Velocity IT inc. http://www.webvelocity.ca/