question

Peter Jones avatar image
0 Likes"
Peter Jones asked Adrian Haws edited

Flexscript Errors preventing roller coaster model from compiling and running properly

Im running the Roller coaster model and it loads ok and runs but will not compile properly.

The GUI reports do not update as expected with no riders loading and the av waiting time not updating.

I get this error in compiler console:

Flexscript ErrorMODEL:/RollerCoaster>variables/messagetrigger Line 65Pointer cast to an integer will lose its value in 64-bit. Use a double or preferrably a more type-safe method. for quite a few lines.

Plus this comment at the bottom:

Could not finish parsing because of previous errors.

FlexSim 16.0.1
flexscript errorroller coaster
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

Arun Kr avatar image
1 Like"
Arun Kr answered Adrian Haws commented

Hi Peter Jones,

I have not looked at the model, most probably the error is because of initializing a variable as int instead of double in line 65.

For instance, the similar error can occur if you assign the number equivalent of an object to an integer variable. In those situations, assign the number equivalent as a double variable.

The number equivalent is made using tonum() command.

treenode object = node("Queue",model());// for example

int objectnum = tonum(object); // wrong way

double objectnum = tonum(object); // right way

Also, check the attached models. error-1.fsm error-removed.fsm

Regards,

Arun KR


error-1.fsm (13.5 KiB)
error-removed.fsm (82.1 KiB)
· 5
5 |100000

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