replacement for quad-CC

Queries and discussions related to migrating from APLX
shallit
Posts: 14
Joined: Fri Oct 27, 2017 12:25 am

replacement for quad-CC

Post by shallit »

Looks like quad-CC has disappeared (it used to be in APLX). What's the easiest replacement?
User avatar
Morten|Dyalog
Posts: 460
Joined: Tue Sep 09, 2008 3:52 pm

Re: replacement for quad-CC

Post by Morten|Dyalog »

It seems to me that ⎕CC performs a number of quite different functions in APLX, some of which are very specific to the GUI environment. There is no direct equivalent in Dyalog APL, although there are ways to achieve most of what I can see in the APLX reference manual. Can you tell us a little more about what you are trying to do?
shallit
Posts: 14
Joined: Fri Oct 27, 2017 12:25 am

Re: replacement for quad-CC

Post by shallit »

I had been using it to do stuff like the following:

print the letters ABC, then three backspaces, then --- (three minus signs) over what used to be the ABC.

Should I be using ⎕ARBOUT instead?
User avatar
Morten|Dyalog
Posts: 460
Joined: Tue Sep 09, 2008 3:52 pm

Re: replacement for quad-CC

Post by Morten|Dyalog »

That does sound like ⎕ARBOUT, yes. Of course, you pretty much need a teletype for that to work, on a screen display the minuses will just overwrite the first letters. There is a feature in Dyalog APL that I consider to be something of an "Easter Egg" - but it can only resolve known overstrikes like underscored letters:

Code: Select all

      chars←⎕FMT 'ABC∆',(4⍴⎕UCS 8),'___|' ⍝ ⎕UCS 8 is backspace
      ⍴chars
1 4
      chars
ⒶⒷⒸ⍋
      ⎕FMT 'ABC',(3⍴⎕UCS 8),'---'
---

If the above displays as circled letters rather than underscores on your screen, that's because you are not using the APL385 Unicode font. Unicode versions of Dyalog APL output underscores as circled letters (because Unicode has no underscored chars) and the font renders them as underscored.
Veli-Matti
Posts: 94
Joined: Sat Nov 28, 2009 3:12 pm

Re: replacement for quad-CC

Post by Veli-Matti »

Oh, this reminds me of the ancient times with mainframes, where you could do some nice tricks with quad output and backspace (e.g. showing the process information in the session). Not to mention the first time I played with APL on paper terminal, and that was the only way to get the overstrike characters.
Had to test:
      ∆bs←{⎕FMT ⍺,((≢⍺)⍴⎕UCS 8),⍵}

(⎕A,'⊥⊤⎕⎕⎕⎕⎕○○○○*∘~∆∆∇∇∨∧0[/\,∊') ∆bs (⎕A⊢¨'_'),'∘∘''÷:=⋄*|-\¨¨¨_||~~~~]---_'
ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ⍎⍕⍞⌹⍠⌸⋄⍟⌽⊖⍉⍣⍤⍨⍙⍋⍒⍫⍱⍲⍬⌷⌿⍀⍪⍷

Nice! What about..
      '⊂⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕|=<>>∇○⊤⊥⍺⍵⍳;⋄∘○∘' ∆bs '_∘○∧∨↑↓←→/\≠?~/__¨¨¨¨________○'
_∘○∧∨↑↓←→/\≠?~/__¨¨¨¨________○

I was expecting these:
      ⊆⌻⌼⍓⍌⍐⍗⍇⍈⍁⍂⍯⍰⍭≠≤≥⍩⍢⍥⍡⍊⍶⍹⍸⍮⍚⍛⍜⌾


So, Toto, this is not paper terminal any more!

-wm
shallit
Posts: 14
Joined: Fri Oct 27, 2017 12:25 am

Re: replacement for quad-CC

Post by shallit »

Unfortunately I still can't get what I want to work. I'd like to output the letters 'abc' on one line of code, with no carriage return, then later output one backspace with no carriage return, then later output 'def' and have it appear finally as 'abdef'.

I just want to output these to the APL window, not a file.

No combination of ⎕ARBOUT, ⎕FMT, or ⍞ seems to work.

Any ideas?
User avatar
Phil Last
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: replacement for quad-CC

Post by Phil Last »

I've not tried this myself but you could implement a global trigger so that you merely assign your outputs to a specified name and the trigger function is designed to recognise control characters and know what to do with them, finally displaying the immutable result, presumably ending with carriage return, to the session.
User avatar
Adam|Dyalog
Posts: 143
Joined: Thu Jun 25, 2015 1:13 pm

Re: replacement for quad-CC

Post by Adam|Dyalog »

Hi shallit,

For that specific behaviour, the following should do:
      ⍞←'abc' ⋄ ⎕DL 1 ⋄ ⍞←⎕UCS 8 ⋄ ⎕DL 1 ⋄ ⍞←'def'

It will display 'abc' then wait a second, then output a backspace (with no visual effect, then change the display to 'abdef'.

If you want the backspace to remove the 'c', use:
      ⍞←'abc' ⋄ ⎕DL 1 ⋄ ⍞←⎕UCS 8 0 8 ⋄ ⎕DL 1 ⋄ ⍞←'def'

It will display 'abc' then wait a second, then change that to 'ab', then wait a second, then change to 'abdef'.
shallit
Posts: 14
Joined: Fri Oct 27, 2017 12:25 am

Re: replacement for quad-CC

Post by shallit »

Unfortunately this suggestion does not work for me. I get no intermediate output at all; it all appears at once and doesn't look like what you said:

∇GO
[1] ⍞←'abc' ⋄ ⎕DL 1 ⋄ ⍞←⎕UCS 8 ⋄ ⎕DL 1 ⋄ ⍞←'def'
[2] ⍞←'abc' ⋄ ⎕DL 1 ⋄ ⍞←⎕UCS 8 0 8 ⋄ ⎕DL 1 ⋄ ⍞←'def'
[3] ∇
GO
abcdefabcdef
User avatar
Adam|Dyalog
Posts: 143
Joined: Thu Jun 25, 2015 1:13 pm

Re: replacement for quad-CC

Post by Adam|Dyalog »

shallit,

What platform (OS and Dyalog interface) are you on?
Post Reply