question

Jonathan avatar image
0 Likes"
Jonathan asked Jonathan commented

How do I watch variables in Flexscript?

I've got custom code on a decision point. Within that I'd like to watch the values of several of the variables I've defined in that code.

My understanding of "Watch Variables" and "Local Variables" is that I'd be able to do this by adding my variable to one of those watch lists. However I can' figure out how to do that.

I've clocked the + on the "Watch Variables" window and nothing happens. There are no variables or data in either of those windows. Additionally I've read that I should be able to mouse over a variable in a running model and a popup should indicate the current value. But this does not happen either.

Do I have to set breakpoints or something? How do I add a breakpoint?

FlexSim 20.2.3
flexsim 20.2.3debuggingvariableswatch variables
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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jonathan commented

You are referencing to Debugging, please read this again. You must set a break point in your source code line by clicking in front of a row number in the white space. Then the red dot occurs. You can close the window. If the program pointer reaches the code line with a red dot, while you are running your model, then the source code editor will pop up.


Tracked Variables have the ability to be watched. But they are also statistical objects.


I suggest you adjust your source code whenever you set a label value and print this event into an output console.

Main Menu > Debug > Output Console


Alternatively or additionally you write it into an open text file. You write data with

  • fpt(..) = write text
  • fpf(..) = write floating value
  • fpd(..) = write discrete value
  • fpr() = line feed with carriage return
· 1
5 |100000

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

Jonathan avatar image Jonathan commented ·

Thank you. I was clicking on the row number to try to set a breakpoint as that is more intuitive.

0 Likes 0 ·