Need a way to add code based on existence of a field
Closed this issue · 2 comments
I need to have a way to add processing based on the existence of a field. I don't know if it is possible to have variables in codegen? So maybe go through a field look and if a field is found, then set a codegen variable... which can then be tested to add specific code...
this would be very helpful for keys and other tests as well. So, if there is a sequence key, then we don't need to generate the keyvalue manually, otherwise, need to generate the key...
Thanks for the suggestion, Greg. There are ways to achieve what I think you are describing, probably using field loops and counters, but it probably would not be pretty, and you'd probably wind up having to use some runtime code also, so not ideal.
Seems to me that something like this might help:
<IF STRUCTURE_HAS_FIELD_somename>
code
Where somename would be replaced with the name of the field you are trying to test for.
If you agree, then I'll add that for the next release?
HI Steve,
As far as the fields go, that sounds like exactly what we are looking to do. That should be great. thank you for the quick Response!
Thanks,
Greg