question

Alessio Merlo avatar image
3 Likes"
Alessio Merlo asked Phil BoBo edited

return type of user command

Hi,

does somebody help me with a compiler error? I am updating an old model to the last version of Flexsim (17.0.2), but I surprised when the compiler console return some error due to return type of my user command.

I can't attach the model, but I replicated the issue in a simple model. I created an user command "sum" which return an "int" value ("double" is the same). When I use the command and I save the return value in an int variables, the compiler returns an error with this reason "Command sum does not return the required type". Why?

I can fix the problem changing the return type of command in num or variant or saving the return value in a variant, but I don't understand the reason of this change. Sometimes I would like to force the return type with a specifc type.

Does somebody help me to understand what is changed in FlexSim 17.0.2?

Thanks in advance.

FlexSim 17.0.2
user commandscompilerreturn type
parsererror.png (49.3 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

Matt Long avatar image
2 Likes"
Matt Long answered Phil BoBo edited

Valid return types currently (for 17.0) are:

  • node
  • obj
  • string
  • str
  • num
  • int
  • double
  • var
  • array

(You can also leave return type empty if returning nothing)

It looks like there is a bug with using int. In the mean time use num instead.

· 2
5 |100000

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