10 Tips for Faster Synergy Development in Visual StudioJanuary 21, 2021
Synergex Developer Support Has Your Back—Now More than EverJanuary 27, 2021
I am pleased to announce the release of a new version of CodeGen, and this release is quite a big one. The changes include the following:
- We added a new command-line option -ncp that suppresses the features of the <STRUCTURE_PLURAL> and <STRUCTURE_NOPLURAL> tokens, making them behave the same as <STRUCTURE_NAME>.
- We modified the non-Synergy data types returned by field loop expansion tokens such as <FIELD_CSTYTPE>, <FIELD_OCTYPE>, <FIELD_SNTYPE>, <FIELD_SQLTYPE> and <FIELD_VBTYPE> for decimal fields with an overall size of over 18 characters. For example, previously <FIELD_CSTYPE> would return long and now returns decimal. And because any field larger than a D28 will overflow even decimal fields in .NET, we now throw an error if any such field is encountered in a structure.
- We added a new type of key loop called a <PARTIAL_KEY_LOOP> that can be used to process subsets of the segments of multi-segment keys.
- We added a new generic expansion token <DAYNAME>.
- We added new field loop expansion tokens <FIELD_CLASS>, <FIELD_DISPLAY_LENGTH>, <FIELD_GROUP_MEMBER_PREFIX>, <FIELD_GROUP_STRUCTURE>, <FIELD_INPUT_JUSTIFICATION>, <FIELD_OVERLAY_FIELD>, <FIELD_OVERLAY_OFFSET>, <FIELD_OVERLAY_SPEC>, <FIELD_PAINTCHAR>, <FIELD_PAINTFIELD>, <FIELD_POSITION_COL>, <FIELD_POSITION_MODE>, <FIELD_POSITION_ROW>, <FIELD_REPORT_JUSTIFICATION>, <FIELD_SELECTIONS_COL>, <FIELD_SELECTIONS_HEIGHT>, <FIELD_SELECTIONS_ROW>, <FIELD_USER_TYPE>, <FIELD_VIEW_LENGTH>, <PROMPT_POSITION_COL>, <PROMPT_POSITION_MODE> and <PROMPT_POSITION_ROW>.
- We renamed some field loop expression tokens that were introduced in the previous release, changing <IF UNFLATTENED_GROUP> to <IF GROUP>, <IF UNFLATTENED_EXPLICIT_GROUP> to <IF EXPLICIT_GROUP> and <IF UNFLATTENED_IMPLICIT_GROUP> to <IF IMPLICIT_GROUP>. We apologize if this breaks existing code, but if so, that code was written in the last few days, and we figured it would not be a big deal!
- We added new field loop expression tokens <IF GROUP_MEMBER_PREFIX>, <IF GROUP_MEMBER_PREFIX_COMPILER>, <IF GROUP_OVERLAY>, <IF NAME_LINK>, <IF OVERLAY_OFFSET>, <IF PAINTFIELD> and <IF USER_TYPE>.
- We changed the behavior of the field loop expansion tokens <FIELD_ENUMBASEVAL>, <FIELD_ENUMLENGTH> and <FIELD_ENUMSTEPVAL>. Previously these tokens would insert 0 for unenumerated fields. Now nothing is inserted for unenumerated fields.
- We changed the behavior of the field loop expansion tokens <FIELD_SELECTIONS> and <FIELD_SELECTIONS1>. Previously these tokens would insert “” for fields with no selection list values. Now nothing is inserted for fields with no selection list values.
- We added a new structure expansion token <STRUCTURE_TYPE>.
- We added a new key loop expression <IF PRIMARY_KEY>.
- We added a new command-line option -pa, which causes array fields not to be expanded into individual fields.
WARNING: This is an experimental feature and may currently cause unexpected side effects with some expression tokens. Please let us know if you encounter anomalies.
- We enabled code generation for structure fields, enum fields, and binary fields. Code generation for these types of fields was previously artificially blocked.
WARNING: This is an experimental feature. While the <FIELD_SPEC>and other basic field loop tokens will behave as intended, some tokens may not behave as expected with these types of fields. Please let us know if you encounter anomalies.
- We removed the field loop expression tokens <IF COERCEBOOLEAN> and <IF NOCOERCEBOOLEAN>. There is a slight chance that this could break existing templates, in which case you can use <IF COERCE_BOOLEAN> and <IF NOT COERCE_BOOLEAN> as direct replacements.
- We fixed an issue that was causing a failure during the processing of very complex expressions.
- We fixed an issue that could cause counter tokens to be incorrectly processed as expressions.
- We addressed a bug that was present in all versions of the Repository API whereby the RpsField.PaintCharacterSpecified property actually indicated whether the field was a paint field, not that a custom paint character was specified. This has now been corrected, and we have added a new property RpsField.PaintField (boolean).
- We moved the implementation of several early Harmony Core specific expansion and expression tokens into the Harmony Core Extensions library.
- We started an ongoing process to reformat and improve this documentation, hopefully making it easier to use and easier to maintain. The most significant change is that expansion tokens were previously documented on individual pages within an overall category, but in the future will be documented on a single page for each category (for example, all field loop expansion tokens). We also started to use manually entered and meaningful topic IDs, which will be a positive change when using the on-line documentation at https://codegen.synergex.com because URL’s will now be based on meaningful names rather than generic topic numbers.
This version of CodeGen was built with Synergy/DE 11.1.1f and requires a minimum of version 10.1.1 to operate.
We recommend that all CodeGen users upgrade to this version, particularly if you are doing Harmony Core development. You can download the new version from GitHub.