question

Ankith T avatar image
0 Likes"
Ankith T asked Jason Lightfoot edited

how to create a function and be able to call it for returning a value.

Hi, i would like to create a function using flexscript, where when i call the function, it has to return the some value according to the calculation i put inside the function.


Example

1690314752039.png


here i am just trying to create a addition function where if i send two values, it has to save that number at specified table and return me the added value "C" for the variable "dd".

FlexSim 21.1.5
customcodefunctionsflexscript coding
1690314752039.png (5.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Julie Weller avatar image
0 Likes"
Julie Weller answered Jason Lightfoot edited

Hi @Ankith T! You can add a function by going to Toolbox -> Modeling Logic -> User Commands. This will allow you to make a little function for your model. You can add the code at the bottom. Here's a link to the documentation for the tool: https://docs.flexsim.com/en/23.1/Reference/Tools/UserCommands/UserCommands.html#app

Let me know if you have any follow up questions!

· 9
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.