starscript icon indicating copy to clipboard operation
starscript copied to clipboard

[Wiki problem] Function syntax is unclear

Open Clozent opened this issue 2 years ago • 2 comments

I tried to use a program that uses this syntax, and I can't find, for example, information on how to specify parameter names in funtions.

Is it: function(arg_name="value"), function(arg_name:"value"), or is it something else?

Clozent avatar Aug 22 '23 13:08 Clozent

you cant specify specific arguments, you need all arguments in correct order

crosby-moe avatar Aug 22 '23 14:08 crosby-moe

Ok, this is a different meaning of the word function, as in subroutine or procedure, a user declared function.

I see listed in the code below Call, Jump, JumpIfTrue, under the comment Instructions used by StarScript... these seem to match programming concepts I have run across in all sorts of languages, and it would change how I think of StarScript.

These would seem to imply the ability to define subroutines or procedures and separately do flow control jumping to line numbers / labels or something to accomplish conditionals and loops? This seems really powerful. Can the Calls and Jumps move flow control to a different line in a multi-line StarScript script in a Meteor macro ? This seems ridiculously powerful and very interesting. Where do I find documentation or further information to explain how to do that ?

https://github.com/MeteorDevelopment/starscript/blob/master/src/main/java/org/meteordev/starscript/Instruction.java

HoratioGamer avatar Sep 06 '23 18:09 HoratioGamer