The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 calling function from LabTalk

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
blt2si Posted - 01/16/2003 : 03:43:08 AM
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);

Thank You,
Blank
5   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 01/23/2003 : 08:32:46 AM
Something like this?


 
bool foo(Worksheet& wks)
{
printf("wks has %d columns\n", wks.GetNumCols());
return true;
}




void test()
{
Worksheet myWks("data1");
foo(myWks);
}




CP


blt2si Posted - 01/23/2003 : 05:11:18 AM
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
easwar Posted - 01/17/2003 : 10:49:33 AM
Hi Blank,

If your Origin C function code is not too large, please post here and we can take a look. If too large, please send to tech support.

Easwar
OriginLab.

blt2si Posted - 01/17/2003 : 04:09:24 AM
Hi Easwar,

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.

Easwar
OriginLab.

easwar Posted - 01/16/2003 : 12:20:46 PM
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.

Easwar
OriginLab.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000