I've never used Code Builder to write an Origin C program. Is there a simple example of how to do this? |
- Click the Code Builder button
on Origin's Standard toolbar.
- Click the New button
on Code Builder's Standard toolbar.
- Select C File from the list box.
- Type MyFile in the File Name text box.
- Select the \OriginC subfolder if it is not currently selected (this should be the default folder).
- Click OK to close the dialog box and open the new file in Code Builder's multiple document interface (MDI).
- Type the following Origin C code beneath the line that reads // start your functions here.
void test()
{
printf("hello world\n");
}
- Click the Build button
on Code Builder's Standard toolbar to compile the MyFile.c source file and to link the Stdio.h header file. The Output window should display:
compiling...
MyFile.C
Linking...
Done!
- To test this function in Code Builder, click in the upper pane of the LabTalk Console located in the bottom right corner of Code Builder. (This is the default location after installing Origin 7. If the LabTalk Console isn't open or you are not sure which window it is, toggle it on and off by selecting View:LabTalk Console in Code Builder.)
- Type the following LabTalk function call in the LabTalk Console and then press ENTER:
test
The phrase, "hello world", displays in the lower pane of the LabTalk Console (as seen below).
- Now make Origin the active application.
- Select Window:Script window to open the Script window if it is not already open.
- Type the following LabTalk function call in the Script window and then press ENTER:
test
The phrase, "hello world", displays in the next line of the Script window.
|
Keywords: ID Number: 777 Item Category: Programming Tip Origin Version: 7.0 Database Information Type: Origin C Code Number of Times Accessed: 4950 Creation Date: 3/1/2002 12:00:00 AM Last Modified: 3/1/2002 12:00:00 AM |
|
|