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 |
#1
|
|||
|
|||
Question about iskeydown() command
Hi all.
I am looking for a way to get FlexSim to terminate code execution. (For instance to be able to prevent infinite loops.) I tried doing this in the code below. The goal was to be able to terminate execution of the code by pressing the left shift key, but I can't seem to get it to work. If the shift key is pressed when I start the code execution, it works, but not if I press while the code executes. Code:
for(int x=1;x<=10000000;x++) { if(iskeydown(16)) return "Shift Key Pressed"; int Number = duniform(1,100000000)+duniform(1,100000000); } return realtime(12); Is there any way I can get FlexSim to 'listen' for a keystroke while executing the code? Best regards Christian |
#2
|
||||
|
||||
Please try Ctrl + Break. This shortcut tries to terminate the code execution.
|
The Following 3 Users Say Thank You to Carsten Seehafer For This Useful Post: | ||
Sebastian Hemmann (01-08-2014) |
Thread | Thread Starter | Forum | Replies | Last Post |
a question about changetask command | oliver xie | Q&A | 6 | 07-13-2012 02:25 AM |
family command? | zhang xin | Q&A | 0 | 01-14-2010 06:33 PM |
a question about the command "getitemtype" | Vic Li | Q&A | 2 | 10-04-2008 11:47 PM |
releaseitem command | AlanZhang | Q&A | 3 | 10-04-2007 10:11 AM |