Waldo.Model.Tools
Waldo.Model.Tools copied to clipboard
Adding assignment of variables
Hi Waldo,
When investigating the UsedBy, it adds the SourceCodeToken element where it nicely shows where the particular searched element is used in code, but it would be a great addition to also list the variable or field a certain field or parameter is assigned to.
For example:
"UsedInSourceCodeToken": {
"CodeModel": "NavModelToolsAPI.Model.CodeModel",
"ParentElement": "Page\u003cTEST Code List Page\u003e.\u003cOnAfterGetRecord\u003e",
"TokenID": 22,
"C_TokenID": 0,
"C_Level": 0,
"WithContext": "",
"Token": 43,
"Length": 4,
"LineNo": 3,
"BeginPos": 27,
"IsWhiteSpace": false,
"EndPos": 31,
"Value": "Code",
"ReferenceElement": "Table\u003cTEST Code List\u003e.Field\u003cCode\u003e",
"VariableElement": "Page\u003cTEST Code List Page\u003e.\u003cOnAfterGetRecord\u003e.Variable\u003cTESTCodeList\u003e",
"UsingElement": "Table\u003cTEST Code List\u003e.Field\u003cCode\u003e",
"TokenType": 1,
"IsKeyword": false,
"IsIdentifier": true,
"SpaceBeforeString": null,
"IsHyperLink": false,
"KnowledgeBaseUrl": null,
"ToolTip": null,
"ForeColor": "Black"
},
This shows the ReferenceElement and UsingElement (which always seem to be the same by the way, not sure what's the difference), but this is the element being investigated. It also shows exactly where in the code it is used (Line No., BeginPos etc.) It would be great if it could show to wich variable it has been assigned to (for nested Where-used loops)
OnAfterGetRecord()
TESTCodeList.GET("Code List Code");
SomeName := Name;
GlobalCode := TESTCodeList.Code; <--
I know, stupid example, but hey... You get the drift ;-)
Thanks, Peter