How to use System and Terminal functions

Hello everyone,

I am trying to use @() and SYSTEM() from Cache Terminal. I am searching for blinking text . I have found -5 as a Screen Display Option but not aware like how to use on terminal.
Can any one please help ?

Thanks,
Gunwant

  • 0
  • 0
  • 109
  • 5
  • 3

Respuestas

Probably not the answer you're searching for but here's an idea:

set i = 0
set text = "Hello World!"
set fill = $justify("", $length(text))
for {
  set i = i+1
  write $char(13) _ $case(i#2, 1:text, 0:fill)
  hang 1
}

Following this useful table (https://stackoverflow.com/a/33206814/82675) you can have blinking text as follows:

USER>write $C(27)_"[5m"_"Hello"_$C(27)_"[0m"

Interesting.

for i=1,5,7,31,32,33,34,35,36,37,40,41,42,43,44,45,46,51,52,53,54 write $j(i,2),"  ",$C(27)_"["_i_"m"_"Hello"_$C(27)_"[0m",!

It sounds like you're using the Multivalue features of Cache. From the MV Shell prompt you can use the semicolon command to execute an MVBasic statement:

 

USER:; crt @(-5):"This is blinking":@(-6):" and this isn't"

 

From ObjectScript, you can use the MV command:

 

USER>mv "; crt @(-5):""This is blinking"":@(-6):"" and this isn't"""

 

or in ObjectScript you can use the $MVAT() function:

 

USER>w $MVAT(-5)_"This is blinking"_$MVAT(-6)_" and this isn't"

 

Thanks Edward.

Can you please provide documentation link for MV basic ?  It will help me to explore more.

If you are coming from a Multivalue background, then documentation for the multivalue features of Cache comes with Cache, or can be found online at https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?K...

If you aren't already using Multivalue, then you can use the examples of ansi terminal control sequences posted above, like

set CSI=$C(27)_"["
; optionally, you could use set CSI=$c(155)
set BLINKON=CSI_"5m", BLINKOFF=CSI_"0m"
write BLINKON_"Hello"_BLINKOFF

Do a web search for "ansi control sequences" for more information. This is of course assuming that you are using a terminal that supports ansi. Cache Terminal does.

If you are going to be doing a lot of terminal control, you probably want to look into mnemonic spaces: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?K.... For example, to blink:

use $io::"^%XDTM"
w /AI,"Hello ",/AA,"World"

Cache comes with 2 routines to use as mnemonic spaces, or you can create your own.