Serializing instances
Monkey Forums/Monkey Programming/Serializing instances
| ||
Hi all, is it possible to serialize an instance of an unknown class, that is a class where I don't specifically know which fields it has. Ta! -Chris |
| ||
You would need reflection for that and Monkey doesnt support reflection. |
| ||
Got ya, thank you. |
| ||
you could write a program in blitzmax to read the monkey file, It would create a method for your class called ToString Blitzmax reads the fields of your class and writes the method to the monkey file I was going to do this myself but havent had a need yet. |
| ||
I have seen a reflection modul some updates ago. So I think Mark is still working on it. Mfg Suco |
| ||
i had a look at the reflection module and its the framework for saving and writing strings to xml basically, you still have to write the code for each individual field. |
| ||
i had a look at the reflection module and its the framework for saving and writing strings to xml basically, you still have to write the code for each individual field. If you're talking about the serialization module in diddy, unfortunately that's the only way I could make things serializable. If Mark adds reflection, I'll change it. |
| ||
still useful though, if i eventually make that blitzmax program |