home *** CD-ROM | disk | FTP | other *** search
Wrap
set nover !------------------------------------------------------------------------------- ! TELNET/TELNETW Attributes DEMO ! Note: Terminal is set to VT320 mode and ! all global d$* symbols are deleted !------------------------------------------------------------------------------- on abort then goto exit on warning then goto exit ! Get SYMBOL22 definition @symbol22 disp d$sc !save cursor & attributes disp d$g1dsg !Set DEC graphics in G1 cls = "disp d$ed" disp = "disp/nocr" set term/device=vt220_7 set term/nopseudo dcoloron = "<esc>[4m" dcoloroff = "<esc>[24m" ! If not color mode, set underline attribute (dcoloron) to bold if 'f$getinfo("color") then goto nochg dcoloron = "<esc>[1m" dcoloroff = "<esc>[22m" nochg: line1 = "''(d$rvon+d$ulon)'REVERSE/UNDER''(d$rvoff+d$uloff)' ''(d$bdon+d$rvon)'BOLD/REVERSE''(d$bdoff+d$rvoff)'" line2 = "''(d$bdon+d$ulon)'BOLD/UNDER''(d$bdoff+d$uloff)' ''(d$bdon+d$rvon+d$ulon)'BOLD/REVERSE/UNDER''(d$bdoff+d$rvoff+d$uloff)'" cls disp d$block(5,1) { ''d$attoff' The 320 Character Attribute set can display text in a variety of modes. ''d$rvon'NORMAL''d$rvoff' ''d$bdon'BOLD''d$bdoff' ''d$ulon'UNDERLINE''d$uloff' ''d$rvon'REVERSE''d$rvoff' It can also differentiate between combinations of attributes with blinking. ''(d$bkon+line1+" "+line2+d$bkoff)' Another option provides for an unerasable field of characters... ''(d$escon+d$bdon+dcoloron)' This line is marked UNERASABLE and will remain after a selective clear screen. ''(d$escoff+d$bdoff+dcoloroff)' } inq/stat input dcoloron + d$rvon + "Type ''(d$bdon+d$bkon)'RETURN''(d$bdoff+d$bkoff)' to erase the screen and the unerasable field will remain..." + d$rvoff disp d$sed !Erase all but unerasable characters delay /nomess 2 disp d$ed !Erase display !------------------------------------------------------------------------------- ! TELNET/TELNETW Boxes DEMO !------------------------------------------------------------------------------- disp d$ed + d$attoff disp [2,20] d$rvon + dcoloron + " BOXES Command File using D$BOX " + dcoloroff disp d$bdon + dcoloron + d$box(1,19,3,60) + d$rvoff+ dcoloroff + d$bdoff disp d$bdon + d$box(20,60,24,78) + d$bdoff disp dcoloron + d$box(1,5,24,10) + dcoloroff disp d$bdon + dcoloron+ d$box(8,20,20,40) + d$bdoff + dcoloroff disp d$rvon + d$box(13,1,18,80) + d$rvoff disp d$rvon + d$bdon + d$box(5,30,22,75) + d$rvoff + d$bdoff disp dcoloron + d$rvon + d$bdon + d$box(7,50,11,65) + d$rvoff + d$bdoff + dcoloroff delay/nomess 2 !------------------------------------------------------------------------------- ! TELNET/TELNETW Display DEMO !------------------------------------------------------------------------------- ! This command file demonstrates the use of DISPLAY and INQUIRE with ! Display Lexical Functions and SYMLEXES !------------------------------------------------------------------------------ cls disp d$block(17,1) { ''(d$bron + dcoloron)' |=====================================================| | INQUIRE/MAX=1/TERMINTE Menu with display placement | | using lexicals d$block(row,col,label) & other | | symbols/symlexs from file SYMBOL22.ECF. | |=====================================================| ''d$attoff' } inquire/max=1/term input d$block(1,1,"box") + d$cup(10,21) + - dcoloron + "Choice" + d$cup(10,30) disp d$attoff cls disp d$block(17,1) { ''(d$bron + dcoloron)' |======================================================| | DISPLAY & INQUIRE/MAX=24 Menu with display placement | | using lexicals d$block() & d$box() with other | | symbols/symlexs from file SYMBOL22.ECF. | |======================================================| ''d$attoff' } disp dcoloron + d$rvon + d$box(2,26,10,79) + d$bdon disp [3,27] " " disp [4,27] " " disp [4,77] " " disp [5,27] " " disp [5,77] " " disp [6,27] " " disp [6,77] " " disp [7,27] " " disp [7,77] " " disp [8,27] " " disp [8,77] " " disp [9,27] " " disp d$attoff disp [5,52] dcoloron + d$rvon + " " - + d$cup(6,52) + " " - + d$cup(7,52) + " " disp d$attoff + d$bdon + dcoloron + d$box(4,29,8,76) disp [4,51] d$g1gl + "w" disp [5,51] "x" disp [6,51] "x" disp [7,51] "x" disp [8,51] "v" + d$g0gl !============================================================================== ! As a convenience, double apostrophes ('') are used to ! distinguish the last character of a line that ends with spaces. !============================================================================== disp dcoloron + d$rvon + d$block(5,30) + d$attoff { Employee '' Address '' City/State/zip '' } inq/stat/max=24 input d$rvon + "Enter name : " + d$rvoff + " " disp [5,52] dcoloron + d$rvon + input + d$attoff inq/stat/max=24 input d$rvon + "Enter address : " + d$rvoff + " " disp [6,52] dcoloron + d$rvon + input + d$attoff inq/stat/max=24 input d$rvon + "Enter city, state and zip code : " + d$rvoff + " " disp [7,52] dcoloron + d$rvon + input + d$attoff delay/nomess 2 cls disp d$block(5,1) { ''(d$bron + dcoloron)' |======================================================| | DISPLAY & INQUIRE/MAX=28/TERMINATE Menu with display | | placement using lexicals d$block(row,col,label) & | | d$box(offset) with other symbols/symlexs from file | | SYMBOL22.ECF. | |======================================================| ''d$attoff' } disp [15,9] dcoloron + d$bdon + d$box(6,50) + d$rvon + d$block(16,10,"text") inq/max=28/term [17,30] input inq/max=28/term [18,30] input inq/max=28/term [19,30] input delay/nomess 2 cls disp d$block(17,1) { ''(d$bron + dcoloron)' |===================================================| | DISPLAY & INQUIRE/KEY Menu with display placement | | using lexicals d$block() & d$box() with other | | symbols/symlexs from file SYMBOL22.ECF. | |===================================================| ''d$attoff' } !============================================================================== ! NOTE: Command substitution with apostrophe(s) (') or ("''") forces ! execution and translation of DISPLAY FUNCTIONS like ! D$BOX or D$BLOCK before symbol translation occurs. ! ! EX: disp d$block(10,10) ! { ! ''(d$rvon + d$box(9,9,11,15))'"Hello" ! { ! ! This example shows the symbol d$rvon which does not turn reverse ! video on before executing the function d$box() to draw the box. ! To work properly the expression should be written as: ! ! ''d$rvon'''d$box(9,9,11,15)'"Hello" ! !============================================================================== ! As a convenience, double apostrophes ('') can be used to ! distinquish the last character of a line that ends with spaces. !============================================================================== disp d$bdon + dcoloron + d$box(1,1,14,80) + d$attoff + d$bdon + d$box(2,2,4,79) disp d$block(3,3) + d$attoff { ''d$bron'Backup''d$rvoff' Archive Restore Verify Utilities Configuration Quit ''d$g1gl' qk lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq x''d$g0gl' Select ''d$g1gl'x x''d$g0gl' Name Script ''d$g1gl'x x''d$g0gl' Go ''d$g1gl'x mqqqqqqqqqqqqqj''(d$g0gl+d$attoff)' } bell = "" right: inq/stat/key input dcoloron + d$rvon + "''bell'Type ''d$uloff'RIGHT ARROW''dcoloron' key to continue..." + d$attoff bell = "<bell>" + d$bdon if (input .nes. "RIGHT") .and. (input .nes. "KP6") then goto right disp [5,3] d$ech(76) disp [6,3] d$ech(76) disp [7,3] d$ech(76) disp [8,3] d$ech(76) disp d$block(3,3) + d$attoff { ''d$bdon'Backup ''d$rvon'Archive''d$rvoff' Restore Verify Utilities Configuration Quit ''d$g1gl' qqqqqqqqqqk lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq x''d$g0gl' Select ''d$g1gl'x x''d$g0gl' Go ''d$g1gl'x mqqqqqqqqj''(d$g0gl+d$attoff)' } bell = "" down: inq/stat/key input dcoloron + d$rvon + "''bell'Type ''dcoloroff'DOWN ARROW''dcoloron' key to continue..." + d$attoff bell = "<bell>" + d$bdon if ((input .nes. "DOWN") .and. (input .nes. "KP2")) then goto down disp [3,3] d$attoff + - " ''d$bdon'Backup Archive Restore Verify Utilities Configuration Quit " disp d$block(5,15) { ''(d$attoff+d$bron)'Select''d$attoff' } bell = "" f1: inq/stat/key input dcoloron + d$rvon + "''bell'Type ''dcoloroff'F1''dcoloron' key to continue..." + d$attoff bell = "<bell>" + d$bdon if input .nes. "F1" then goto f1 disp d$attoff + dcoloron + d$rvon ! Demonstrate an exploding window using escape sequences ur = 6 ltc = 48 lr = 12 rtc = 72 rc = ((lr-ur)/2)+ur cc = ((rtc-ltc)/2)+ltc rc1=0 cc1=0 cnt = 0 loop: disp d$box(rc-rc1,cc-cc1,rc+rc1+1,cc+cc1+1) rc1=rc1+1 cc1=cc1+3 cnt = cnt+1 if cnt .ne. 3 then goto loop disp d$box(ur,ltc,lr,rtc) disp d$block(7,49) { This exploding window demonstrates just how flexible and complex user defined display commands can become. } inq/stat input d$attoff + d$rvon + "Type ''dcoloron'RETURN''dcoloroff' to continue..." + d$rvoff exit: set term/pseudo disp d$rc + d$cup(24,1) ! Restore cursor & attributes delete sym /glo d$* exit text: { '' Enter name : ____________________________ '' Address : ____________________________ '' City/State/zip : ____________________________ '' '' } box: { <ESC>)0 <SI> ''d$bdon'<ESC>[?25l <ESC>[3;29HFILE TYPE MENU <ESC>[5;21H1. ASCII <ESC>[6;21H2. Binary <ESC>[7;21H3. Fixed Record Length (512byte) <ESC>[8;21H4. Exit <SO> ''d$bdon'''dcoloron'<ESC>[2;18Hlqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk <ESC>[3;18Hx<ESC>[3;54Hx <ESC>[4;18Hx<ESC>[4;54Hx <ESC>[5;18Hx<ESC>[5;54Hx <ESC>[6;18Hx<ESC>[6;54Hx <ESC>[7;18Hx<ESC>[7;54Hx <ESC>[8;18Hx<ESC>[8;54Hx <ESC>[9;18Hx<ESC>[9;54Hx <ESC>[10;18Hx<ESC>[10;54Hx <ESC>[11;18Hmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj <ESC>[?25h <SI> ''d$attoff' }