In FlexSim, it is possible to produce a string representation of almost any value using the print command. However, there doesn't seem to be an equivalent method for converting values to the string type.
I have a function that accepts a var as input, and the var can contain either a number or a string. Is there a way to convert this value into a string without knowing what its type is?
Trying to simply cast an integer to a string in the following code does not work
var testVal1 = 1; string result = testVal1.as(string);
Using string.fromNum on a string causes an exception
var testVal2 = "2"; string result = string.fromNum(testVal2);
I realise it is possible to cast the value to a Variant and then switch based on its type, but I was hoping that whatever method is used to convert data of any type to a string in the print function is available for users too.