This example shows how to automate the dialog generating procedure by creating X-Function with X-Function builder. You can open X-Function Builder by choosing X-Function Builder on the Tools menu or by pressing F10:
The steps below will walk you through the creation of an X-Function that will perform the task of copying data from one column to another column:
2. After you make the necessary changes to the variables, save the X-Function by clicking the Save OXF file button . When the Save As dialog appears click the Save button.
3. Now we need to write the Origin C code that will do the work for our X-Function. Click on the Code Builder button . This will open the X-Function in Code Builder where we can write our Origin C code. In the main function, add the following Origin C code:
ocol = icol;
4. Click the Compile button and then click the Return to Dialog button to go back to X-Function Builder. Click the Save OXF file button.
We can test our X-Function now:
After the X-Function executes, the worksheet will contain a third column which will contain a copy of the data from column A.