Toggle AutoStatus

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

Toggle AutoStatus

Postby kai on Thu Aug 24, 2017 7:16 pm

I really think there should be an ⌶ for doing this, and I want to encourage everybody sharing my opinion to say so in this thread because then Dyalog might actually implement this.

However, Vince provided a slightly dirty Windows-only solution:

      ToggleAutoStatus←{
⍝ Toggle whether the AutoStatus menu item is checked or not.
⍝ ⍵ must be either 1 (checked) or 0 (not checked) or `?`.
⍝ Otherwise an error is thrown.
⍝ Use this to temporarily switch it off and back on again later.
⍝ Returns the status of the menu item as shy result.
⍝ A '?' as right argument reports the status without any change.
~(⊂⍵)∊0 1 '?':'Invalid right argument (0, 1 or ''?'')'⎕SIGNAL 11
currentStatus←↑1↑↑(//)⎕VFI 2 ⎕NQ'.' 'GetEnvironment' 'ShowStatusOnError'
⍵≡'?':r←currentStatus
(,currentStatus)≡,⍵:r←currentStatus
f←⎕NEW'Form'(⊂'Visible' 0)
b←f.⎕NEW'Button'(⊂'Event'('Select' '[AutoStatus]'))
_←0 ⎕NQ b'select'
1:r←~currentStatus
}


Background is that sometimes I do stuff that is known to produce unhelpful error messages in the status window. Fire for example investigates variables under certain circumstances, and that can - though rarely - result in "Cannot be owned by a status bar" which does not help at all, so I want to hide that from the user.
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: Toggle AutoStatus

Postby kai on Wed Sep 06, 2017 10:45 am

So, nobody is supporting the idea? Ah well...

I've edited the original function; as it turned out sometimes "currentStatus" is an empty vector, therefore

Code: Select all
currentStatus=⍵:r←currentStatus


needs to be

Code: Select all
(,currentStatus)≡,⍵:r←currentStatus
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: Toggle AutoStatus

Postby Morten|Dyalog on Thu Sep 07, 2017 7:24 am

I support the idea of an I-Beam to toggle autostatus (especially because we need something cross platform), but it is part of a larger body of issues so we won't be looking at it until after Dyalog'17.
User avatar
Morten|Dyalog
 
Posts: 453
Joined: Tue Sep 09, 2008 3:52 pm


Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest