I know that there are many interfaces for other languages to send user
input to a q application.
However, to keep things simple for me, I just want to deal with user
input on the command line of the console screen. (q is my first
attempt at learning a language, other than my native English)
So, I would like to know: how do I write to the console screen and
accept user input from the console, while in a q session?
I know that I can pass arg's at boot-up when starting a q app... but I
want to do it while the q session is running. (I also know that I can
edit the q script, alter the existing arguments and load the new
script while a session is running, but I want it to be a screen
operation)
For instance, I am building a simple market-data generator. Nothing
fancy, just a zero-drift martingale with constant volatility. It spits
out a simulated time-series at regular intervals and writes the id,
date, time and price to a table which is able to be displayed on the
console screen. After the table gets to be a certain size it rolls the
data off the top of the screen in FIFO fashion and adds the new data
at the bottom.
At the moment, the volatility and period length for data generation
are set as constants.
I want to be able to change them at any time, including during the
session.
If anyone knows how to write to the console screen and collect
something like:
....
Enter Volatility [.20] : _ .40
Enter Period Length [250] : _ 12
Thank-you For Your Variables! The Program Will Take Good Care Of
Them...
....
Such that I can print those messages to the screen and....wait, on the
same line... for the input response and capture those values for later
use in the app.
As a practical exercise in helping me to learn and better understand
this language, this app will be my pseudo ticker-plant. I will run it
on a local server session and have it send data to the local client
subscriber session using inter-process communication.
Later, I will add my stochastic volatility algorithm, randomize the
price/trade frequency and introduce multiple, simultaneous time-
series.
Thanks for any assistance,
Q.
Sent from my iPhone
> --
> You received this message because you are subscribed to the Google
> Groups "Kdb+ Personal Developers" group.
> To post to this group, send email to personal-
> kdb...@googlegroups.com.
> To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en
> .
>
Thank-you Timothy, your code is very helpful and appreciated.
Special thanks to your iPhone. :)
Q.