02-02-2012 06:56 AM
Hi all,
I use CVI 8.5 but only now I started using the Interactive Execution window. I have some global variables in my main.c but they are not recognized in the interactive window ("Undeclared identifier panelHandle" for example).
Can anybody give me an example or a link of how to use this Interactive Execution window?
Thanks!
Kristel
02-02-2012 08:54 AM
Interactive Execution Window is intended as a quick way to execute and test small portions of code; it has no interaction with the source code you are editing in other windows: all code and variable definitions must lie entirely within that window and some limitations apply to it.
Here you can read the online help page describing the IEW
02-02-2012 09:38 AM
Roberto,
Although I use the IEW for small code snippets only and hence have not yet tried to use it together with global variables, the help on IEW says that the IEW can access functions and data declared as global in a Source window... Did I get it wrong, too?
02-02-2012 10:12 AM - edited 02-02-2012 10:14 AM
Well, I didn't noticed it!
I made some test and IEW can effectively catch variables declared as global in a source file, but not if declared in a include file common to all source files in the project. Since all my global declarations are in such files I cannot get them in the IEW. I conformed with it and probably this is the reason I dodn't noticed that small note in the help.
02-03-2012 01:59 AM
Hello Roberto,
many thanks for your answer. Could you give me a little example of those tests you did? that would be very helpful!
Regards,
Kristel
02-04-2012 04:21 PM
Well, it's no difficult...
Open a project of yours, run it in order to link it and have the variables filled with some value, next go to the execution window and type
extern int myVariable; DebugPrintf ("%d\n", 'myVariable);
replacing 'myVariable' with one variables of yours: its value will be printed in Debug Execution window.
This works provided the variable is declared as global in a source file but not as static.