08-16-2012 12:47 PM
@Lewis G wrote:
If not sure whether it is good or bad, but to pass the Search criteria around I use the Flatten to String and Unflatten from string. I guess this is ok providing I use TypeDefs which I have.
I recommend using variants instead of strings for passing un-typed data. Flattening to a string requires making a copy of the data and storing it in a different format. Converting to a variant just creates a pointer to the existing data that says it's now a variant, so it's much more efficient.
08-17-2012 10:09 AM
While I recommended using user events for passing the data i will add that we generally have some libraries of events messages we use. These libraries actually use an AE to manage the events. In the library we have code to initialize the event reference as well as returned the reference. Within the body your application code you generate the events using the library calls. Overall it is a much better method since the code becomes much clearer. Your cod ehas a VI called something like Generate System Exit Event or Generate System Stop Event. These VIs accept the appropraiet data assocaied with the event. It is a nice scalable way of using the events and makes the code much more readable and maintainable.