Scripts/Session Utilities

From J Wiki
Jump to navigation Jump to search

&This is a collection of productivity utilities for J Session Manager.


Select Globals

Produces a selectable list of global definitions in current script window. After selection, locates the definition.

This utility was rescued from j406 and adapted for j601. Originally part of jadelib.ijs is was broken as reported JForum:general/2004-May/017786 Regardless of its usefulness, it was removed from future versions. [{{#file: "smutil.ijs"}} Download script: smutil.ijs ]

NB. smutil - session manager utilities
NB.
NB. 07/25/2006 Oleg Kobchenko adapted from j406

cocurrent 'jijs'

NB.*selactive v list of global definitions in current script window
selactive=: 3 : 0
  fl=. id2name qsmact ''
  if. '.ijs' -: _4{.fl do.
    'n x'=. globaldefs smread smselact ''
    's t'=. wdselect ('Globals - ',fl);<n
    if. s do. smscroll t{x end.
  end.
  empty''
)

It is bound to a function key in Configuration or in code like this [{{#file: "smutil.ijs"}} Download script: smutil.ijs ]

NB. smsetcmd 'f9';'1';'Select Globals';'selactive_jijs_]require ''user/smutil.ijs'''

-- Oleg Kobchenko <<DateTime(2006-07-25T04:43:05Z)>>

Open Most Recent Script

Shortcut for menu File|Recent...Open. It opens the very recent script worked in J Session. Useful in situations when you crash a lot or you accidentally close a script. [{{#file: "smutil.ijs"}} Download script: smutil.ijs ]

NB.   open {. RECENT_jijs_

It is bound to a function key in Configuration or in code like this [{{#file: "smutil.ijs"}} Download script: smutil.ijs ]

NB. smsetcmd 'f11';'1';'Open Most Recent';'open{.RECENT_jijs_'

-- Oleg Kobchenko <<DateTime(2006-08-03T09:06:23Z)>>

Name-Value List

Shows name list with same parameters as nl or names but with associated values. Convenient to browse with grid. [{{#file: "smutil.ijs"}} Download script: smutil.ijs ]

NB.*nvl v name-value list with nl/names format
nvl_z_=: (,. 3 :'5!:5<y'&.>)@nl

Examples

   <@:;"1@|:' PS_' nvl_jgl2_ 0
+--------------+-+
|PS_DASH       |1|
|PS_DASHDOT    |3|
|PS_DASHDOTDOT |4|
|PS_DOT        |2|
|PS_INSIDEFRAME|6|
|PS_NULL       |5|
|PS_SOLID      |0|
+--------------+-+

   >@(LF&cut)&.> 'form' nvl_j_ 3
+-----------+---------------------------------------------------+
|formedit   |3 : 0                                              |
|           |require '~system\extras\util\formedit.ijs'         |
|           |y conew 'jformedit'                                |
|           |)                                                  |
+-----------+---------------------------------------------------+
|formeditrun|3 : 0                                              |
|           |'form file'=. y                                    |
|           |load file                                          |
|           |if. +./'coclass' E. 1!:1<file do.                  |
|           |  t1=. 'object=:''''conew''',form,''''             |
...

See Also