Announcement

Collapse
No announcement yet.

Is there a way to get a dictionary structure in 4DGL?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a way to get a dictionary structure in 4DGL?

    Hello,

    Is it possible to have a key-value pair data structure in 4DGL?

    This occurs from the fact that data coming over SPI may be a number, corresponding to which, I may need to show a string. Currently, I have to make this using a switch statement inside a function and calling that function from the place where this string needs to be printed.
    However, if there were a simple key-value pair data structure, like Python's dictionary object, it would be so much simpler. The overhead of function calls could be avoided and also make it syntactically simple to understand.

    4DGL experts, your help is needed.

    Best Regards,
    Vishal Sapre

  • #2
    Hello Vishal,

    You can achieve similar result by using #CONST and #DATA blocks. Please see attached file for reference.

    Best regards,
    Sherwin
    Attached Files

    Comment

    Working...
    X