Restore table from Base64
-
Hi guys! I'm trying to load a table from a base64 string when a button is on. I'm using the following code:
inline function onDynamicsButton1Control(component, value) { if(value == 1) { A1_Close_CC.restoreFromBase64(24...............vO...f+....9iclgpO); } }; Content.getComponent("DynamicsButton1").setControlCallback(onDynamicsButton1Control);
But it gives me the following error:
Interface:! Line 572, column 46: Found '.' when expecting identifier {SW50ZXJmYWNlfHwxOTIwOHw1NzJ8NDY=}
I'm sure it's something obvious at this point but I'm kind of lost. What am I missing?
Thanks!
-
Strings have to be in quotes
""
-
Thanks, I've changed it to:
inline function onDynamicsButton1Control(component, value) { if(value == 1) { A1_Close_CC.restoreFromBase64("24...............vO...f+....9iclgpO"); } }; Content.getComponent("DynamicsButton1").setControlCallback(onDynamicsButton1Control);
But now I'm getting:
Interface:! Line 638, column 39: function not found {SW50ZXJmYWNlfHwyMjQxN3w2Mzh8Mzk=}
-
@tomekslesicki Could you show the declaration for
A1_Close_CC
? -
Actually that error is on a totally different line so probably not related to the previous error.
-
@tomekslesicki said in Restore table from Base64:
.restoreFromBase64
Line 638 is the line I've pasted but I figured it out, I named the table and the modulator the same Thanks again, David!
-
Ok, it just turned out it doesn't work after all ;-)
@d-healey , I'm declaring the table like this:
const var A1_Close_CC_Table = Content.getComponent("A1_Close_CC_Table");
And the table itself is added as a table via Interface Designer.
-
Yeah I don't think you can restore a table control from a base64 string. If the table connected to a table processor you could restore the table processor and this should update the table control too.
-
Thanks, good to know :) I made a workaround so it's all good.
-
@Christoph-Hart Could we get the ability to restore script tables (or tableData objects)? I have several tables using referToData and I'd like to be able to restore their shapes.
-
@d-healey You have that method in the
TableProcessor
object so maybe this is already enough, but I could add it to the various table classes too at some point. -
@Christoph-Hart I couldn't get it to work with a script table or table data object.