You've picked up the previous pointer, but what's wrong with using a foreach? I'm just trying to understand what your motivation is are you serialising data or something like that.
idle wrote: ↑Mon Apr 26, 2021 7:46 am
You've picked up the previous pointer, but what's wrong with using a foreach? I'm just trying to understand what your motivation is are you serialising data or something like that.
I am writing an universal procedure to write the content of a structured variable to a string or file, like InsertJSONStructure(). But not as JSON or XML but as a Python dictionairy. To get it universal, it must be based on the address alone, just like InsertJSONStructure()....
idle wrote: ↑Mon Apr 26, 2021 7:46 am
You've picked up the previous pointer, but what's wrong with using a foreach? I'm just trying to understand what your motivation is are you serialising data or something like that.
I am writing an universal procedure to write the content of a structured variable to a string or file, like InsertJSONStructure(). But not as JSON or XML but as a Python dictionairy
Ok thanks.
That's tricky to do for an arbitrary structure at runtime as we don't have the required reflection information to serialize the structures, I have tried in the past and it's messy but you can do it with JSON, so maybe it's easier to do that and then convert it to Pythons dictionary format which is a Trie.
Lebostein wrote: ↑Mon Apr 26, 2021 7:57 amI am writing an universal procedure to write the content of a structured variable to a string or file, like InsertJSONStructure().
InsertJSONStructure is a special function that we cannot build ourselves. The PB compiler creates a data section for this command with the variable names and so on, because normally neither structures nor variable names exist at the end in the EXE file.
There is a keyword Runtime which can be used to make the PB compiler store variable names etc. in the EXE, but this does not work with structures.
Code like this confuses me since this is the very reason databases exist.
SQL supports querying a database schema and tables.
SQL supports reading/writing a database's contents.
If you want to reproduce the programming generics of a database, you will fall short and most likely fail.
If you want to hardcode some specific structures, then you might have a slight speed advantage over SQL, but you still fail in that any structure changes force more code changes.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
What exactly am I doing here? And why I scroll backwards to the list?
Very good. I have the same feeling when I am drunk and I just have forcomen to open the door of my car with a hanger after having lock up the car keys inside the passenger compartment !
What about if you insert a list element pointer change ?
-->