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, Please look at src\Runtime\XSharp.Core\RDD\CursorProperties.prg
This file already has an enum for the cursorproperties and a function to translate the string to the number.
And instead of hardcoding the dictionary, I am using the Enum.GetValues() and Enum.GetName() methods
I would also use the Enum for the default values and not the string
Finally, instead of the long list of IF ... statements I would cast the long to the enum and then use a SWITCH statement. That is easier to read and slightly faster.
On the other locations I would also cast nProp to the CursorProperty enum once, so you do not need to use an (LONG) cast in all comparisons.
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.
The current behavior on the RDD side is not wired yet. That will come later with
TABLEUPDATE/TABLEREVERT.Cursor properties are stored per-workarea using the existing _WorkareaCargo container (same slot as
GETFLDSTATE/SETFLDSTATE).CURSORSETPROP("Buffering", 1-5, [area])CURSORSETPROP("AutoIncError", lValue, [area])CURSORSETPROP("Refresh", nValue, [area])CURSORGETPROP("SourceType")returns 3 (table)CURSORGETPROP("SourceName")returns DBF full pathCURSORGETPROP("Database"), "SQL", "ConnectHandle", etc. returns sensible defaultsI used the
CursorPropertyenum fromXSharp.Core.RDDfor property lookup instead ofString.Compare.