This article might contain pre-Unicode character-mapped APL code.
See here for details.
Hacker's Corner: Flying WindowsA little while ago I was shown how to edit the file that produces the screen saver Flying Windows. Windows is supplied with Flying Windows displaying the Windows logo which is actually defined as the very last character in the WinDings font (¯1↑⎕av). The screen saver program file SSFLYWIN.SCR includes this character just before the word DISPLAY. It is very easy to edit SSFLYWIN.SCR using Write with the no conversion option, and to paste the character of your choice from Character Map. I got fed up doing it this way because there was always the chance that I might muck up the file, and I found it difficult to visualise what the WingDings characters looked like at large font sizes. For a bit of fun I wrote an APLIWIN function to allow me to select the character from a list of big WingDings, and eventually came up with the following:
∇ wingdings;a;s;C;V;⎕io  ⎕io←0  C←⎕av ⋄ V←⎕av  a←'pc menu;pn Wingdings;'  a←a,'xywh 30 0 35 200;'  a←a,'cc l1 listbox ws_border ws_vscroll lbs_notify;'  a←a,'cfont -35 0 0 0 400 0 0 0 2 3 2 1 2 "Wingdings";'  a←a,'ctext ',V,(,(⎕toapl 33↓¯1↓⎕av),[0.5] C),V,';'  a←a,'xywh 10 200 30 15;'  a←a,'cc Ok Button;cn "&Ok";'  a←a,'adjw 10;cci Cancel;cn "&Cancel";'  a←a,'csel l1;cfocus;'  a←a,'pmove 0 0 100 230;'  a←a,'pcenter;pshow;ptop;wait;'  s←¯1↓⎕wd a  �⎕wd 'pclose;'  →(s[6 7]≡' 7')↓0  →(0=(⎕toascii ¯1↑s) ⎕hfwritex '\windows\ssflywin.scr 11762')/0  'File write problem' ∇I wanted this to be a completely self contained function, so there are no sub-functions, nor any global variables. Also, it is tailored for my screen size of 800 by 600 pixels. I had to muck about a bit with the numbers on lines ,  and  to get the list box about the right size on the screen. To get the numbers for the argument for cfont, on line , I ran '*data' wdg wd 'mbfont;', and selected a suitably sized WingDing font. I let the results splat out onto the APLIWIN session manager, and then just cut and pasted them into my function. I found the magic number on line  by reading in the entire file and searching for the word DISPLAY:
⎕io←0 a←⎕hfread '\windows\ssflywin.scr' ¯1+('DISPLAY'�⎕toapl a)/⍳⍴a 11762I quite like the snowflakes, but there are lots of other possibilities.
(webpage generated: 28 March 2006, 06:49)