Path not registering as string
geologic
Function waveloader(fullpath)
string fullpath
LoadWave fullpath
end
and used this (and variations of) this command:
waveloader(:Macintosh HD:Users:username txtfile.txt)
I get the "Expected string variable or string function" error. Sometimes I get "Got "Macintosh" instead of string variable or string function name."
My understanding of the function I wrote is:
I create a function named waveloader which is looking for an object called fullpath. I then define fullpath as a string. I then look to use the built-in LoadWave function to access the string fullpath, and accept that as input. Then the function ends.
Is a file path not a string?
Also LoadWave without a /G, /J or /F flag tries to load an Igor binary wave file. Use the Data->Load Waves->Load Waves dialog to generate the appropriate command for your file.
August 31, 2014 at 04:40 pm - Permalink
The Data --> Load Waves --> Load Waves dialog produces this
General text load from "txtfile.txt"
Data length: 180, waves: System_Clock__s_, Time__ps_, Axis_1_Position___m_, Inphase__X___V_
and: Quadrature__Y___V_, Magnitude__V_, Phase_Angle__deg_
which now matches the output of my function:
string fullpath
LoadWave/G/W/A/O fullpath
end
Is there a way to show the command or procedure that would be used to achieve the same result as an Igor GUI?
September 1, 2014 at 11:01 am - Permalink
If you choose Data->Load Waves->Load Waves the dialog will generate a command and add it to the history area where you can inspect it. You quoted the output from the command, not the command generated by the dialog.
The help for LoadWave explains the conditions under which it displays an Open File dialog.
September 1, 2014 at 03:00 pm - Permalink
Thanks.
September 2, 2014 at 11:50 am - Permalink
Thanks.
September 2, 2014 at 11:50 am - Permalink
If you choose Data->Load Waves->Load Waves the dialog will generate a command and add it to the history area where you can inspect it.
September 2, 2014 at 11:46 pm - Permalink