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
 Insering OriginC program as a menu item

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
rikseventyseven Posted - 06/22/2009 : 10:34:07 AM
Origin Ver. 8.0987
Operating System: Win XP

Ok, the problem is simple. I wrote an originC program which compiles and run absolutely fine.
Now I wont to create a new entry in one of the Menu (Analysis) in order to run the program by a simple click.

I followed the procedure described in the manual:

- Made a small script that defines the menu;
- Changed the INI file in order to call the script above
- Restarted Origin...

And it does not work!
The LoadOC function returns 1 and the menu is not created.
The weird thing is that when I copy and paste the script in the command window it works perfectly and the menu item is there...

what is wrong?!

---------------------------------------------------
menu -wg; // available for worksheet or graph
menu 7; // activate View menu
// define menu command text and script
menu (SuperProgram)
{
int err;
err = run.loadoc("Super.cpp");
if (err!=0)
{
type -b "Cannot load file Super.cpp";
}
else
IJoint;
};

-------------------------------
"Stay hungry, stay foolish."
2   L A T E S T    R E P L I E S    (Newest First)
rlewis Posted - 06/22/2009 : 12:33:43 PM
Perhaps the OC compiler was not finding your file ...
The following example was taken from one of my scripts that I use to do more or less what you have been trying to do

Hope this helps ...


menu -w;

menu 1; // File menu

/////////////////////////////////////////////////////////
// RNAHL's Special Import Scripts                      //
/////////////////////////////////////////////////////////
menu -L -i 17 (Import S&pecial);

menu "CSC MC-DSC Files H? and C? Files" {
      #Import CSC MC-DSC datafiles
	%J=System.Path.Program$;
	%J=%JOriginC\system\rnahl\;
	if(run.loadOC("%JImportSpecial\MultiCellDSC\HartConv.c")!=0)
	{
		ty -q Cannot Load Origin Support File HARTCONV.C;
	}
	else
	{
		ty -q Loading Origin Support FIle HARTCONV.C;
		Read_Hart_HC_DataFiles();
		
	}      
                                        };

rikseventyseven Posted - 06/22/2009 : 10:35:32 AM
I realized that I miscopied the script:

menu -wg; // available for worksheet or graph
menu 7; // activate View menu
// define menu command text and script
menu (SuperProgram)
{
int err;
err = run.loadoc("Super.cpp");
if (err!=0)
{
type -b "Cannot load file Super.cpp";
}
else
Super;
};

----------------------------------------------------

Actually when origin start the script is executed but the error message is displayed...

-------------------------------
"Stay hungry, stay foolish."

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