Asked • 07/19/19

CreateTextFile Method is basic fails to create file at specified path?

I am using BASIC for the first time to automate a LeCroy Oscilloscope. Following examples provided by them I am attempting to create a program which uses the oscilloscope features and prints measured values to file. The oscilloscope specific features appear to function correctly but the file creation code does not create the file at the specified path. Private Sub MakeFile() fso = CreateObject("Scripting.FileSystemObject") MyFile = fso.CreateTextFile("E:\ est.txt") End Sub When run the script produces nothing. As I haven't used BASIC before this and it naively seems like this should, as a bare minimum, create the file at the path specified. Certainly it seems to compared to the examples provided by LeCroy. I use this method as the examples provided make use of: On Error Resume Next Set fso = CreateObject("Scripting.FileSystemObject") Set MyFile = fso.OpenTextFile("D:\\Hardcopy\\logfile.txt", 8, True) Also the basis of the Oscilloscope is a Windows 7 PC and they claim that both BASIC and their additional methods work within the system. I don't know if this is just me being completely unable to BASIC or if there is a nuance I am missing. Alternatively there may be a way to implement this within the LeCroy system that is different to this. If anyone can verify if this would work if it was straight up BASIC OR if you know programming for a LeCroy 'scope, how would I go about file creation on one, since this isn't working. Thanks!

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.