09-24-2008 05:53 AM
hi,
i am in need of one requirement in my current appliction.There is one enum control which has name of the material.That enum should get updation programatically.But programmatically it is not possible to update the enum unlike ring.can u give me any idea..
09-24-2008 06:59 AM
You gave the answer in your question: use a ring. You can't update enums programmatically.
(Which case should a case structure connected to an enum execute if you add a new element?)
09-24-2008 07:13 AM
dan_u wrote:You gave the answer in your question: use a ring. You can't update enums programmatically.
(Which case should a case structure connected to an enum execute if you add a new element?)
Right you are Dan!
Your reference to the case structure is the big "gotcha" associated with changing enums.
Now to just to explore the edges of the "LabVIEW World" ("There be dragons here.") there is a way to push this limit a bit but it can only be done under very specail controlled conditions.
IF
You are running in the developement environment (so that the code can be recompiled)
AND
All of the cases driven by the enums have a "Default case" defined,
THEN
You could create a "Launcher" that opens the typed def of the enum and write the "strings" and then save it before (this is important because you can't write the strings of an enum that is part of an app that is resreved to run) opening the app that uses the enum, and then run the app you COULD change the enum on the fly.
But under most situations the ring is the way to go.
Ben
09-24-2008 07:24 AM
Ben wrote:
IF
You are running in the developement environment (so that the code can be recompiled)
AND
All of the cases driven by the enums have a "Default case" defined,
THEN
You could create a "Launcher" that opens the typed def of the enum and write the "strings" and then save it before (this is important because you can't write the strings of an enum that is part of an app that is resreved to run) opening the app that uses the enum, and then run the app you COULD change the enum on the fly.
But under most situations the ring is the way to go.
Ben
This is very true of course.
I just thought to give the quick answer that is - in most situations - the best solution
09-24-2008 07:45 AM
dan_u wrote:...This is very true of course.
I just thought to give the quick answer that is - in most situations - the best solution
Yup!
I just like to point out the loop-holes every now and then. Sooner or latter some nut-job (like CC) will jump through one and come back reporting amazing creatures they found in the rabbit hole.
"...take the red pill and find out how deep the rabbit hole goes." (Morphius, The Matrix)
Ben
09-24-2008 08:49 AM
Ben wrote:
dan_u wrote:...This is very true of course.
I just thought to give the quick answer that is - in most situations - the best solution
"...take the red pill and find out how deep the rabbit hole goes." (Morphius, The Matrix)
Ben
For anyone interested, here's a receipe for the red pill.
Ton
09-24-2008 11:30 PM
Raghupati
Any specific reason you wanted to use enum and not ring.
Ring can do the job for you.
Vinamra