ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#2
|
|||
|
|||
Hello Vadim,
What Flexscript nodes do you mean? On the triggers of a Trigger page of an object, you can add breakpoints for debugging. It is also possible to add breakpoints in User Commands. So if you are talking about user defined flexscript nodes, you could either call a User Command in the Flexscript node or create a GUI where you make the Flexscript node visible. I am not sure if you can debug easily in Flexsim 6 when you are using the default settings, but if you switch off the 'use logic builder by default' on the Environments tab of the Global Preferences, you will see the code as in Flexsim 5. Esther |
#3
|
||||
|
||||
Edited:
I have found the answer to my question. Please see next post. Was: Hi Esther, I am not using the logic builder. Sorry if my previous post was not clear - I am referring to flexscript saved in nodes in an arbitrary location rather than in triggers and User Commands. I am trying to figure out a way to structurize my code by pulling function implementations from User Commands to flexscript-toggled nodes inside the objects from which they are called as a way of preserving object-orientedness in order to improve component reusability (I know I can add a customized object to a user library, but if it will not work if a function it uses is implemented elsewhere). It works, but debugging those nodefunctions is a nightmare. While adding a breakpoints in triggers and user commands is trivial, placing a breakpoint in a nodefunction in an arbitrary location on a tree is very difficult - if I can step into the function it will be opened in the debugger and then I can add a breakpoint. For nodefunctions called via TASKTYPE_NODEFUNCTION this approach does not work at all. One work around is creating a clone of a routine in User Commands for debugging, but it is impractical for commercial software development. I was hoping there is an easy way to create a node on the tree, toggle it as flexscript, and set a breakpoint there. I wonder how difficult is it to set a breakpoint via the command prompt window by executing something like setbreakpoint("MAIN:/project/model/MyObject>methods/MyMethod", 1) in the command prompt in order to set a breakpoint in the nodefunction MyMethod, line 1 within MyObject. There's got to be something like that happening in the background when you toggle a breakpoint by clicking. |
#4
|
||||
|
||||
Never mind, just found an answer.
Code:
debug([num operation, num/obj p2, num/obj p3]) Description: For developer use. This command is used to control the Flexscript step debugger. Calling this command without any parameters will behave as if there is a breakpoint at that line of code. Operations: DEBUG_STOP 0 DEBUG_STEP 1 DEBUG_CONTINUE 2 DEBUG_IS_STOPPED 3 DEBUG_GET_LINE_NR 4 DEBUG_DUMP_VARIABLES 5 DEBUG_STOP_SIMULATION 6 DEBUG_REFRESH_BREAK_POINTS 7 DEBUG_ADD_BREAK_POINT 8 DEBUG_DELETE_BREAK_POINT 9 DEBUG_GET_WATCH_VARIABLE 10 DEBUG_ENABLE_CODE_PROFILING 11 DEBUG_PRINT_CODE_PROFILING_INFO 12 DEBUG_RESET_CODE_PROFILING 13 Example: debug(); |
The Following 3 Users Say Thank You to Vadim Fooks For This Useful Post: | ||
Esther Bennett (09-25-2012) |
#5
|
|||
|
|||
Right click the node and select Explore As Code. Then you can place the breakpoints in the normal way.
|
The Following 8 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Vadim Fooks (09-25-2012) |
Thread | Thread Starter | Forum | Replies | Last Post |
How to debug through vcpp project? | william aponte | Q&A | 3 | 04-08-2010 03:42 PM |