wixette / isb

Interactive Small Basic (ISB) - Simple scripting language to be embedded in Unity games or shell environments.
https://www.nuget.org/packages/ISB/
Apache License 2.0
24 stars 3 forks source link

Array initialisation short-form #24

Open ratkingsminion opened 3 years ago

ratkingsminion commented 3 years ago

In MS Small Basic, arrays can be initialised with a string:

arr = "a=100;b=999;"
TextWindow.WriteLine(arr["b"]) ' prints 999

This doesn't seem to be possible with ISB - is there an alternative for that?

wixette commented 3 years ago

The code doesn't work as expected in the online editor of Microsoft Small Basic: http://superbasic-v2.azurewebsites.net/

ISB is a derived project of https://github.com/sb/smallbasic-editor, which is the source code of the online editor.

ratkingsminion commented 3 years ago

Understood, that's too bad. It would be great if it'd be possible to create arrays on a single line to simulate a variable amount of method parameters. Anyway, it's not too important, especially as I could just parse the string myself.