Create file using OPEN command
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2014-01-20 09:45 AM
2014-01-20
09:45 AM
Does anyone have code to demonstrate how to create a new text file and choose its path?
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2014-01-21 05:39 AM
2014-01-21
05:39 AM
The below code will open a file and output text to it. To output to the beginning of the file change recordID and fieldID to 1. The text to output can be string parameters or actual text strings.
filepath = "C:\Temp\Temp.btl" fileID = open("TEXT", filepath, "separator = '\t', mode = wo, fullpath") output fileID, recordID, fieldID, "text to output 1", "text to output 2" etc... close fileID
AC24 (7000 AUS FULL)| Windows 10 Pro | Intel Core i7-12700 @ 2.1GHz | 32GB RAM | NVidia T1000
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2014-01-21 11:42 AM
2014-01-21
11:42 AM
Thanks. That works as long as I specify a folder path for the file, but I'm not so familiar with how that works on a Mac. (I can only get it to save to /Users/
Ideally, I'd like to save into the same folder as the file (though that won't be easy with Teamwork files). Does anyone have a code that will prompt to choose a folder to save in? Using the DIALOG switch doesn't seem to pop up a prompt as I would expect it to.
Ideally, I'd like to save into the same folder as the file (though that won't be easy with Teamwork files). Does anyone have a code that will prompt to choose a folder to save in? Using the DIALOG switch doesn't seem to pop up a prompt as I would expect it to.