Author |
Topic  |
|
Mike Buess
USA
3037 Posts |
Posted - 02/25/2003 : 7:42:40 PM
|
I'm distributing an OC file via OPK and occasionally need to update it. The modified OC file unpacks and I try to recompile it in the OnAfterSetup section of OPKSetup.ogs like this...
[OnAfterSetup] run.LoadOC("%YmyFolder\MyOCfile"); - more stuff -
But that doesn't seem to work. (list f does not show new functions.) I've checked to make sure that the OC file was actually replaced and it was. I've even deleted the precompiled file (OCTemp\MyOCfile.OP) in the OnAfterSetup and OnBeforeSetup sections, but to no avail. It seems like Origin doesn't recognize that my OC file has changed until I restart Origin, when it compiles fine. Is there a way to force a recompile in SR3?
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 02/26/2003 11:02:20 AM |
|
easwar
USA
1965 Posts |
Posted - 02/26/2003 : 12:56:26 PM
|
Hi Mike,
Did you try the Option arugument for the run.loadoc()call? For instance, run.loadoc("filename", 2) forces the file to be rebuilt.
The options are documented under the "Compiling and Linking from Origin" of the Programming help file.
Easwar OriginLab.
|
 |
|
Mike Buess
USA
3037 Posts |
Posted - 02/26/2003 : 1:08:54 PM
|
Hi Easwar,
Yes, I tried run.loadOC("filename",2) in the OnAfterSetup scripts and later in the same Origin session from the script window. It still won't compile until after a restart.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 02/26/2003 1:10:03 PM
Edited by - Mike Buess on 02/26/2003 1:17:09 PM |
 |
|
Gary Lane
USA
150 Posts |
Posted - 02/26/2003 : 4:19:33 PM
|
Hi Mike,
This is a guess but I wonder if this is a queing problem...that is...opk file is still busy unpacking when the run.LoadOC is executed. I recommend trying any of the following codes as a test:
[OnAfterSetup] type -b "Wait a few seconds and then click OK."; // Just a test not a fix run.LoadOC("%YmyFolder\MyOCfile");
[OnAfterSetup] sec -p 30; // awkward fix? run.LoadOC("%YmyFolder\MyOCfile");
[OnAfterSetup] ;run.LoadOC("%YmyFolder\MyOCfile"); // better fix? preceeding ; causes delay until prior commands finish
Let me know if this fixes it for you. Also, make sure Code Builder is closed when you drop your OPK file in Origin.
-Gary
|
 |
|
Mike Buess
USA
3037 Posts |
Posted - 02/26/2003 : 5:10:05 PM
|
Hi Gary,
I'll try those things but am not hopeful of the results. As I mentioned in my previous post, run.loadOC() doesn't even work when I enter it in the script window after dropping the OPK file and its OnAfterSetup scripts have finished. (And I've tried rerunning it several times in the same session.)
But I'll watch out for CodeBuilder this time.
Thanks,
Mike Buess Origin WebRing Member |
 |
|
cpyang
USA
1406 Posts |
Posted - 02/26/2003 : 5:56:48 PM
|
There is run -cr filename command but you will need to know the full path. For example, I have a file called getnum.c that is inside Originlab folder in the EXE path, then
%P=system.path.program$; run -cr %Poriginc\originlab\getnum;
will remove this file from workspace so that subsequent run.LoadOC can add it back and force recompiling to take place.
I suspect that your case will be like,
run -cr "%YmyFolder\MyOCfile";
CP
Edited by - cpyang on 02/26/2003 5:59:01 PM |
 |
|
Mike Buess
USA
3037 Posts |
Posted - 02/26/2003 : 6:17:17 PM
|
Gary - Looks like it was a queing problem after all. This worked...
[OnAfterSetup] ;run.loadOC("%YmyFolder\MyOCfile",2); // doesn't work without the ,2 option
CP - I might also try your suggestion just to get a feel for what's going on.
...It turns out the delay isn't necessary after all. This works just as well (even though I was sure I tried it before without success).
[OnAfterSetup] run.loadOC("%YmyFolder\MyOCfile",2);
......I think I understand my earlier confusion about the ",2" option now.
The first time I unpack the OPK the new OC file is actually different than the old one. Even so, the ",2" option is necessary to recompile it. Compiler messages in Origin's status bar confirm that it's being compiled.
With subsequent unpackings the OC file is the same and there are no compiler messages even with the ",2" option. That led me to believe that the OC file was not being compiled, but I'm not sure about that any more. In any case, it hardly matters if the OC file hasn't changed.
Thanks to all,
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 02/26/2003 6:25:49 PM
Edited by - Mike Buess on 02/26/2003 7:21:43 PM |
 |
|
|
Topic  |
|