Problem Transferring Structures between Procedures
| jjweimer | June 26, 2009 - 08:16 | ||
|---|---|---|---|
|
I have two procedure files within the same experiment .... // PROCEDURE FRAC #pragma rtGlobals=1 // Use modern global access method. Static Structure MyStruct variable tc endstructure Function ChangeStructure(ms) STRUCT MyStruct &ms ms.tc = 1 return 0 end // PROCEDURE FRIC #pragma rtGlobals=1 // Use modern global access method. Static Structure MyStruct variable tc endstructure Function SendStructure() STRUCT MyStruct ms ms.tc = 0 ChangeStructure(ms) return 0 end Trying to compile these gives an error message for Fric:SendStructure ... reference variable is of a different type. When SendStructure() and ChangeStructure(ms) are within the same procedure, I get no compile error. What am I missing? Igor 6.1.0.7 under Windows Vista. |
|||


Joined: 2007-03-01
Location: United States
This is just a guess, but you're defining the structure in both of your procedure files. Even though the actual definition is the same, perhaps when Igor compiles the two files it stores the two structure types separately, such that your call to ChangeStructure() from SendStructure() would use a different representation of the structure than what is defined in the procedure file FRAC.
Joined: 2007-08-14
Location: United States
Oh! Duh! Not only that, but the Structure definition must not be static. The proper set up is ...
and
Thanks!
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH