Giving a name to an dyalog instance in Windows

General APL language issues

Giving a name to an dyalog instance in Windows

Postby paulmansour on Thu May 21, 2020 8:52 pm

The title bar of the session form displays CLEAR WS - Dyalog, etc for a clear workspace. If a workspace is loaded, it displays the full name of .dcs file. I tend to have many workspace instances open all of which are "clear", especially if testing client/server code, reverse proxies, origin servers, etc. I'd like to give a name to an instance. So I can do something like:
      ⎕WSID←'Origin Server 8080'
and that works, mostly, except '.dws' is tacked on to the end. I know its a minor problem, but it is somewhat unsightly, and may give the false impression we are looking at a traditional workspace opened from a .dws file. I don't suppose there is a secret I beam that allows me to set the window caption?
paulmansour
 
Posts: 420
Joined: Fri Oct 03, 2008 4:14 pm

Re: Giving a name to an dyalog instance in Windows

Postby petermsiegel on Fri May 22, 2020 5:50 am

At least under Mac OS 10, appending a period avoids the added dws suffix:
Code: Select all
   ⎕WSID←'Origin Server 8080.'
Result: Origin Server 8080.

Appending a NULL char works even better (nothing visibly appended):
Code: Select all
   ⎕WSID←'Origin Server 8080',⎕UCS 0
Result: Origin Server 8080

Of course, ⎕WSID having an odd value may lead to unexpected results:
Code: Select all
       ⎕WSID
Origin Server 8080?.dws      ⍝ ? is actually a special Unicode symbol (in place of NULL)
      )save                 ⍝ Saves as 'Origin Server 8080' sans NULL and sans '.dws'
Origin Server 8080 saved Thu May 21 23:12:54 2020
This may well be a serendipitous bug in some C-code somewhere and hence fragile.
petermsiegel
 
Posts: 141
Joined: Thu Nov 11, 2010 11:04 pm

Re: Giving a name to an dyalog instance in Windows

Postby Phil Last on Fri May 22, 2020 7:10 am

There actually is a facility for doing just what you want. I believe workspace id Dyalog version and various other parameters are available as elements within the output. I used it for a while a year or two ago but in the end dispensed with it and can no longer remember how to invoke it.

But there's also the fact that if you include a dot in the name Dyalog assumes what follows is the desired extension and doesn't add another. Because I frequently use different Dyalog versions I tend to set it to
      ⊢⎕wsid←'V',1⊃⎕wg'APLVersion'
V18.0.38293.0
Can be tricky if I have multiple sessions in the same version but usually I don't.
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: Giving a name to an dyalog instance in Windows

Postby AndyS|Dyalog on Fri May 22, 2020 7:11 am

Hi Paul

You might like to take a look at http://help.dyalog.com/17.1/#UserGuide/Installation%20and%20Configuration/Window%20Captions.htm.

With this you cannot alter the session caption from within Dyalog, but you can at least define what fields appear in the caption. From experience incLuding {PID} is the best way of uniquely identifying each Dyalog process, which comes in handy when you're trying to send an interrupt to.

I generally set the caption for MessageBox, Session, Status and Systray - and for my purposes I like to use {VER_A}{VER_B}{SCHARS}{BITS} {PID} {WSID}:{SNSID}

You might also find it useful to call 2022⌶ - Flush Session Caption.


Hope this helps.
Andy
User avatar
AndyS|Dyalog
 
Posts: 257
Joined: Tue May 12, 2009 6:06 pm

Re: Giving a name to an dyalog instance in Windows

Postby paulmansour on Fri May 22, 2020 11:36 am

Thanks all!

Andy, in V18, will that stuff be able to be specified in the new dcfg config files as opposed to the registry?
paulmansour
 
Posts: 420
Joined: Fri Oct 03, 2008 4:14 pm

Re: Giving a name to an dyalog instance in Windows

Postby kai on Fri May 22, 2020 2:12 pm

As far as I am concerned, having the process ID (PID) on every single window that the interpreter might throw at me is is indispensible.
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: Giving a name to an dyalog instance in Windows

Postby AndyS|Dyalog on Fri May 22, 2020 4:02 pm

Hello Paul

The subjunctive case is a wonderful thing !

It should is as far as I am prepared to go at the moment. I'll do some digging as I'm always wary of dealing with values in subkeys of the Dyalog registry key.

However, in 18.0 the registry is certainly still in use.
User avatar
AndyS|Dyalog
 
Posts: 257
Joined: Tue May 12, 2009 6:06 pm


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest