hi all, I wrote a LabTalk script file and named as newone.ogs. The following is the main script for importing the text file.I created an object button to execute my code and i included the run.section behind this button..Here ChangeFormat is the function name which is written in CodeBuilder to change the textfile format into excel worksheet.Finally i was succeeded to import the text file but i was unable to change the format,it is appearing as it is(i.e: same as the raw text file). Is this correct to call the function which is written in codebuilder? if not please suggest me how to call the function.
// Filename: newone.ogs
// Main Code
[Main] // type -b $General.Userbutton;
win -t data C:\Program Files\OriginLab\Origin7Server\dataN.otw; getfile *.txt; open -w %a; ChangeFormat(%a);
Was your Origin C function compiled and linked before you executed this script? Did you see any error messages in the script window that indicated that this Origin C function was not available?
I suggest that you try to test the OC function independantly by typing: ChangeFormat(filename) in your script window and see if it works.
Also, note that you can add script that would automatically load, compile and link your OC function so that this process can be part of your script as well. This can be done using the run.loadoc() script command. Look in the help files for more documentation on this command.
Thank you for your reply.I tried with both of the options run.section and run.loadoc().I noticed error messages in the script window that it is showing the following error: Origin C Function Runtime Error, failed to find object during method call can you please tell me why this is coming?
Thank You, Blank
quote: Hi Blank,
Was your Origin C function compiled and linked before you executed this script? Did you see any error messages in the script window that indicated that this Origin C function was not available?
I suggest that you try to test the OC function independantly by typing: ChangeFormat(filename) in your script window and see if it works.
Also, note that you can add script that would automatically load, compile and link your OC function so that this process can be part of your script as well. This can be done using the run.loadoc() script command. Look in the help files for more documentation on this command.
Hi Easwar, I changed the script from labtalk to origin.i wrote new code for importing the text files..it is working as i expected. i imported the text file data into some source work sheet and now i want to change this into required format..for that reason i included another function call in my origin function...how can i call another function by sending this worksheet as an argument? in new function also i define new worksheet which is the final one. now i want to access the source worksheet to load the data into the final worksheet..please suggest me ... Thank you, Blank