Hi There,
I am trying to create a .txt file without having to put the .txt file name in the code. I want to run the code against the form and pick up fields from that form and let the user save the txt file on their own.
fileNum% = Freefile()
fileName$ = “C:\temp\test5.txt” ← I want either notepad to open up with the values from the form if possible???
or create a file on its on without having to have the file physically in the folder?
Any assistance is appreciated.
Thanks!
Subject: create txt file
Your question is very confusing. Are you saying you want to create a text file but not create a text file?
First of all, explain what the ultimate goal is.
My guess is that what you really ask is something like this:
A Notes document (by the way, it is not called “form”, that is a design element) is processed, and the field values are saved in a text file. The name of the text file, and the location of the text file, is selected by the user.
Of course you can’t create a file without actually creating it.
You can:
-
allow the user to specify filename and location (use the SaveFileDialog method of the NotesUIWorkspace class)
-
build a temp file (use the Environ() function to get %TEMP% from the operating system) and then launch it in an external editor
-
Automate Notepad or some other editor and insert the content directly there
I think the first method is the best way to do it.
Subject: RE: create txt file
My apologies … I like writing how I think in my mind :S but you did a great job understanding what I required 
#1 was basically what I had wanted. Works like a charm!
Thank you!!!
Subject: RE: create txt file
I have many years of experience with end-users who have problems explaining what they really want, and who can’t write a coherent specification/explanation, so it was not that hard.
However, if you are working as a developer it is important that you work on not only understanding what your tools can do and how to do it, but also how to clearly describe in writing what you want to accomplish with your code and how it will work.
What I always do after a meeting with the stakeholder(s) in a project is to turn around and send everyone onvolved in the meeting an email where I (very detailed and clearly) specify how I understand they want the process/code/application to work. I have them either clarify any details I may have misunderstood, or approve it. I don’t start writing any code until they have approved that detailed specification.
That way they can’t later come back and say that they wanted it a different way and that I misunderstood.
In addition to this, when you ask for help in forums like developerWorks or StackOverflow, it is critical that you explain what you really want in a clear and detailed way. This allow people to actually help you, instead of having to guess what it is you want/need.