You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Irwin,
The workareas (datasession) class has a mechanism to add data to a workarea/cursor.
There is a cargo dictionary for this. The key is the area number and the value is an object..
This was added for the XPP dialect that has functions for that.
The workareas class has a method SetCargo(dwNum, oObject) an GetCargo(dwNum) to set and get the object
When a workarea is closed, then the cargo slot for that area is cleared.
You could also use the same slot for the field information that you are storing.
Finally the IRdd interface has a FieldIndex method that you can use to lookup the field number for a fieldname. That is MUCH faster than looping through all the fields what you are doing now in _FieldNumFromName(). The implementation in the Workarea class uses a case insensitive dictionary for this. And for tables in a DBC both the short and long name are stored in this dictionary.
One more thing: if you want we can also add a bitarray field to the RDD where we store which field numbers were updated. That would be fairly easy to do.
Thanks for the tips, I've applied both suggestions. Regarding the BitArray in the RDD, that sound like a good plan for the next step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
GETFLDSTATE()andSETFLDSTATE(). State is tracked per workarea using an internal dictionary. Both functions also use_AreaFromParam().They were marked as Partial since automatic state updates on REPLACE/APPEND require cursor buffering (CURSORSETPROP), which is not yet supported.
Closes Peter Stephan feedback item: GETFLDSTATE / SETFLDSTATE.