Origin Version: 7.5 SR5
Operating System: Win XP SP2
I'd like to pass a string as an argument from a Labtalk script to an OC function. Is that possible? I've been getting an error with the following setup:
Inside a *.ogs file:
[LTCode]
type -b "Choose data file.";
getfile *.dat; //Stores filename to %A, file path (with trailing \) to %B
cFunction(%B%A);
type -a %A;
Inside a *.c file:
int cFunction(char * input)
{
printf("Input is %s\n\n",input);
return 0;
}
When I try to run by typing cFunction("Hello") in the script Window I get a Command Error.
When I try to run it by clicking a toolbar button that's set to run the [LTCode] section, I get no output to the Script Window.
In fact, I can't get output to the script window even if the OC Function is just a Hello World function and has no input parameters.
Is it possible to pass string variables to OC functions from LabTalk? If it isn't possible, how to I access the Labtalk string variables that I want the OC function to know about?
Is it possible to ensure that printf output from OC functions goes to the script window even when the OC function is started from a button that runs a labtalk script? (which in turn calls the OC function) If not, how do I view printf output from OC functions? (I still would like to call the function with a toolbar button.)
BG
P.S. I feel like some of my questions were a bit confusing. Please ask me to reword them if necessary.