getchar or some such thing needed? #781
sanjayjain159
started this conversation in
General
Replies: 2 comments
-
Without know exactly what you are building, I'm not sure exactly what you want. It sounds like you want something like Python's KeyboardInterrupt? Otherwise, I recommend using Ctrl-Z to interrupt (and later resume) execution of programs. This is a feature of the shell, not of Janet, though. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sorry, I will explain more. I had used BASIC for data acquisition earlier and there was a branching instruction ON KEY GOTO/GOSUB which was useful to direct program execution at touch of key. I was wondering how to do something similar in Janet.
I now realize Janet has better mechanisms such as event module and perhaps even file/read since in unix even the keyboard is a file.
Still I would appreciate your thoughts on this.
BR,
SJain
…On 2 September 2021 4:02:10 AM IST, Calvin Rose ***@***.***> wrote:
Without know exactly what you are building, I'm not sure exactly what
you want. It sounds like you want something like Python's
KeyboardInterrupt? Otherwise, I recommend using Ctrl-Z to interrupt
(and later resume) execution of programs.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#781 (comment)
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am an engineer, and an end user of janet. I wish to apply it to scientific data acquisition and analysis. One situation in daq is to interrupt program execution by means of a keystroke on the keyboard, for example the special function key F1 or any other key. Janet getline cannot be used since there is no newline char here. How would this be done in Janet?
Beta Was this translation helpful? Give feedback.
All reactions