In addition to bill lam's excellent advice, there's also http://code.jsoftware.com/wiki/Guides/Window_Driver/Command_Reference which may interest you.
Consider, for example: wd 'timer 30000' |value error: sys_timer_z_ | (i.0 0)"_ sys_timer_z_$0 |value error: sys_timer_z_ | (i.0 0)"_ sys_timer_z_$0 |value error: sys_timer_z_ | (i.0 0)"_ sys_timer_z_$0 Now, if I define: sys_timer_z_=: verb def 'sdt=: 6!:0 y' and wait for the timer event to go off, I have a value for sdt And, now that I see that it's working (so I do not have to shut down my J session to regain control), I can make the timer event run more often: sdt 2016 4 16 14 11 27.4896 wd 'timer 1' sdt 2016 4 16 14 12 30.5991 sdt 2016 4 16 14 12 31.4788 Here, I have asked jqt to keep executing that command line ((i.0 0)"_ sys_timer_z_$0) once every millisecond whenever I'm not doing anything else. (The way it works, if something long running is happening, that command line can't be run, so those events get skipped.) But maybe keep in mind mickey mouse's experience in fantasia (the sorcerer's apprentice): if this gets out of control, you'll have quite a mess to clean up. I hope this helps, -- Raul On Sat, Apr 16, 2016 at 9:24 AM, bill lam <[email protected]> wrote: > std is a noun, (or a value in other programming languages). It is usually > immutable. Just curious, why didn't you write > sdt=: 6!:0 > ppchk=: 9!:10 > or > sdt=: 3 : '6!:0 y' > > min=: 3 :0 > {: 5 {. sdt y > ) > > For the other question, IEEE double precision is limited to 15 or 16 > significant digits, so that print precision cannot improve accuracy. > On Apr 16, 2016 6:48 PM, "Martin Kreuzer" <[email protected]> wrote: > >> One of my teachers once told me "It's even sillier to not ask a silly >> question" ... so here I go: >> >> Extracting SystemDateTime I do get a vector like this >> ] sdt=. 6!:0 '' >> 2016 4 16 9 12 59.257 >> which -from now on- has that value >> sdt >> 2016 4 16 9 12 59.257 >> >> To get the current minute I might do something like >> ] mins=. {: 5 {. sdt >> 12 >> which gives the same result some time after, unless I explicitely do >> ] mins=. {: 5 {. sdt=. 6!:0 '' >> 30 >> >> Q: >> Is there a way to sort of "wrap" the foreign (6!:0 '') so that "sdt" will >> show the _current_ date/time string when called..? >> (Sorry if I missed to make myself clear.) >> >> Same question arose when e.g. trying stuff like >> -- check print precision >> ppchk=. 9!:10 '' >> -- set print precision >> ppset=. 3 : '9!:11 (y)' NB. seems to work ... >> ppset 7 >> >> 9!:10 '' >> 7 >> ppchk >> 7 >> ppset 11 >> >> 9!:10 '' >> 11 >> ppchk NB. has (of course) still the previous value ... >> 7 >> >> And (again) here comes the silly >> Q: >> Is there a way to define "sdt" or "ppchk" (from above) so that they >> immediately react to changes to the environment..? >> (Looks to me if I'm asking for a verb without a noun to act on; is that >> the moment the empty string ('') comes into play and the dog chases its >> tail..?) >> >> -M >> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
