How to store a function name in a file or DefData?
BlitzMax Forums/BlitzMax Programming/How to store a function name in a file or DefData?
| ||
I try to read the Name of a function and store it in a Type. Is it possible to do that on any way? Type tCmd Field Value1:Int Field Value2:Int Field myFunction() End Type c:tCmd = New tCmd RestoreData myData ReadData c.value1, c.value2 'ReadData c.MyFunction '<<< Her's the Prob. c.MyFunction = fc_Test '<<< Works c.MyFunction 'Execute Function Function fc_Test() Print "It Works" End Function #myData DefData 10, 5, "fc_Test" |
| ||
not as far as I know, the best way is to do a comparisonif c.MyFunction = fc_Test then fc_Test() 'or a select...case Select c.MyFunction case "fc_Test" fc_Test() End Select |
| ||
Better then nothing. Thanks. |