home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / sharew / exoten / rec / ayuda.cnv < prev    next >
Encoding:
Text File  |  1990-10-24  |  5.6 KB  |  150 lines

  1. [AYUDA.CNV]
  2. [G. Cisneros, 10.9.90]
  3. [Include &u]
  4.  
  5. [Load]
  6. (()()(0 1 2)(
  7.     ((and,<[4]>,<0>).0000<1>=<2>,(if,(%r,ARR:blk[(#Hd,<0>)]),<>,<<
  8.     >>(%Or,<2>)<<
  9.     >>(%W,ARR:blk[(#Hd,<0>)],<<
  10.     >>(REC#(2rpG 1$ryGH63+ [Get available & reqd. memory]
  11.         pG46N'*File too big'mLL;
  12.         16/&LpGmN'*Out of memory'nLmL; [Quit if not enough]
  13.         lyG-,2S [Adjust available no. of paragraphs]
  14.         0,6r|lyG 16* 2- wz0qLS JD [set up new workspace]
  15.         6rn+ 6S [Adjust base of available mem.]
  16.         @C'Loading help file 'TL2$ryt
  17.         @R [Read help file into new workspace]
  18.         Zz(B26%ED:0%ED:;) [Clean ending NULs and ^Zs]
  19.         J''w!mw [Reactivate original workspace]
  20.         lyGI [Insert hex block for new WS];)#))<<
  21.     >>(%C,<2>)(REC#nI#))):
  22.     (*<0>,(C)(,(%r,TTY:<0><,> press (<)return(>) to continue )));
  23.     ((and,<[4]>,<0>).,*File too big):
  24.     (,<=>(REC?QDH(26x^''wml26$S;L;)w    [Save WS block, set up alternate WS]
  25.         (27x^1858c27$S;L;)    [23-line buffer]
  26.         ''(14858FzqL|:;)    [find all sections (LF :)]
  27.         28x(29x(p4/28$SL29$S    [save block ptr in 29, len in 28]
  28.         (Zz<@C>28$r64mJj    [label selections w. letters]
  29.         ((d;'HELP error - Fewer sections than headings'TLxM)
  30.          n^pGm%'. '|TL10%Vqtz':'(EL):;)
  31.         (Zz<@E>'Letter = Select a section, 'TL
  32.         (25x^'^ or ctrl-C = Exit';
  33.         L'^ = Up one level, ctrl-C = Exit ';)TL
  34.         R3%=Zz<@C>xE_;'^'=nLZz<@C>3;
  35.         Zz<I'&''u'x&J'A'lyG%(M)ZD>x+'Invalid selection'TL:
  36.         nLQD>\65-,4*;)3=;
  37.         29$r+pG4+ 4GYBj4GY
  38.         ':'Ez(13%U''w26$ryGQmw@Cn'New level: Searching for 'TLTI
  39.             25$r^25$Sm<@SJA;25$rd25$S;)JZD>nw:
  40.         <<''1m        [delimit section, mark PDL, set panel No.]
  41.         (23(d10%(Fz;L):;)JQ27$rywmD<@CI@Q@E>nw
  42.         q|z(ABlyG#;'EOS';)x+'    'TLTL': 'TL
  43.         (25x^'^ or ';L'^ = Up one level, ';)TL
  44.         'ctrl-C = Exit, M = Menu,'TL(lyG 1=;L' S = Start,'TL;)
  45.         x+'    'TL(lyG1=;L'L = Last, 'TL;)'other = Continue 'TL
  46.         R ZzI<'&''u'x&JQD>'S'=nL(''=;L:)''1m>JZ<:
  47.             'M'=0;3%=Zz<@C>xE_;'^'=3;
  48.         n1(=1)&'L'(=;&)dmL>YZ<:^mLpGYz>Z<AB:0;)
  49.         nLm(''=;L:)n3=>>;
  50.         L>>:)
  51.         L2x:(25x^ 0,27$SL 0,26$Sn; d25$S26$ryG;)w
  52.         ?));
  53. )) L
  54.  
  55. [Display a screenful line by line]
  56. (()()(0 1)(
  57.     (<0>(^J)<1>,(M,<0>(^J))<1>):
  58.     (<>,);
  59.     (,(M,<=>));
  60. )) Q
  61.  
  62. [Expand tabs while writing to the screen]
  63. (()(
  64.     ((IF,(0),<=>        ,(and,<[8]>,<0>),(REC?0$ryt?))) H
  65. )(0 1 2)(
  66.     ((and,<[8]>,<0>(^I)<1>)<2>,(H,<0>)<1><2>):
  67.     ((and,<[8]>,<0>)<1>,(REC?0$ryt?)<1>):
  68.     (<0>(^I)<1>,(H,<0>)<1>):
  69.     (<[1]>,<=>(REC?qtD?));
  70. )) M
  71.  
  72. [Main program -- set up list of HLP files from PATH]
  73. ((
  74.     [PATTERNS:]
  75.     [A letter]
  76.     ((or,(IVL/A/Z/),(IVL/a/z/))) l
  77.     [A digit]
  78.     ((IVL/0/9/)) d
  79.     [A number]
  80.     (<:d:>(ITR,<:d:>)) n
  81.     [A valid file name character]
  82.     ((or,<:l:>,<:d:>,$,&,#,%,<'>,<(>,<)>,-,@,^,{,},~,`,!)) h
  83.     [One or more valid characters]
  84.     (<:h:>(ITR,<:h:>)) s
  85.     [A valid name (with extension, if there is one)]
  86.     ((and,<:s:>,(NOT,<[9]>))(or,.(and,(ITR,<:h:>),(NOT,<[4]>)),)) f
  87.     [A valid prefix]
  88.     ((or,<:l:>:,)(or,\,)(ITR,(or,..,.,<:f:>)\)) g
  89. )(
  90.     ((until,(%r,<2>,<[512]>),<>,<=>,(%r,<2>,<[512]>))) R
  91.     [Append \ to subdirectory names]
  92.     ((WHILE,(0 1),<=>,<0>;<1>,(if,<0>,<:g:><>,<=>;,<=>\;),<1>)) Z
  93.     [Get the "PATH" environment variable; make list of available
  94.      HLP files with their lengths.]
  95.     ((if,(%Or,CTR:fs)<<
  96.     >>(WHILE,(0 1),<0>;(IF,(0),<30>,<-->PATH=<0>(^@),(Z,<0>;),),<0>;<1>,<<
  97.         >>(until,(%S,<0>*.HLP),Not Found,<<
  98.         >>(IF,(2 3),<=>,<[5]>(and,<[4]>,<2>)<3>,<<
  99.             >>(#pDh,(%r,CTR:fs)).(#h,<2>)=<0><3>(^M)),(%A),),<1>,),<<
  100.     >><>,(%t,No HLP files found)(%M),<<
  101.         >>(if,(%r,CTR:fs)(%C,CTR:fs)(%Ow,ARR:ct,2,6),,<<
  102.         >>(%W,ARR:ct[1],<=>)(%W,ARR:ct[2],(#Dh,<=>)))<<
  103.         >>(%Ow,MEM:lst,(#+,(&!,<=>)+32))(%W,MEM:lst,<=>)<<
  104.         >>(%Ow,ARR:blk,(%r,ARR:ct[1]),24))<<
  105.      >>(%t,AYUDA.CNV(^MJ)<<
  106.     >>Copyright <(>c<)> 1990 - Gerardo Cisneros(^MJ)<<
  107.     >>DERECHOS RESERVADOS(^MJ))<<
  108.      >>(,(%r,TTY:Press (<)return(>) to continue ))) P
  109.     [Find file by name]
  110.     ((IF,(0),<=>(%Or,MEM:lst),<0>,<<
  111.     >>(%R,(1),MEM:lst,(itr,<-->(^M))(and,<[13]>=<:g:><0>,<1>)(^M),<1>,))) F
  112.     [Find file by number]
  113.     ((IF,(0),<=>(%Or,MEM:lst),<0>,<<
  114.     >>(%R,(1),MEM:lst,(itr,<-->(^M))<0>.<1>(^M),<0>.<1>,))) N
  115.     [Set active page to 0, clear screen, home cursor]
  116.     ((%G,5,al=0)(%G,6,al=0,bh=3,cx=0,dh=24,dl=79)(%G,2,bh=0,dh=0,cl=0)) C
  117.     [Clear last two lines, put cursor at 23,0]
  118.     ((%G,6,al=0,bh=3,ch=23,cl=0,dh=24,dl=79)(%G,2,bh=0,dh=22,cl=0)) E
  119.     [Display and get a choice]
  120.     ((%Or,MEM:lst)(C)<<
  121.      >>(while,X(%r,MEM:lst),X,,<<
  122.         >>(if,(IF,(0 1),<=>,X<0>.<[8]>=<1>,<<
  123.         >>(%W,TTY:,        (#Hd,<0>). <1>(^MJ))<<
  124.         >>(if,(#%,(#Hd,<0>)%23),0,<<
  125.             >>(X,(#-,(#Hd,<0>)-22):(#Hd,<0>)),<<
  126.             >>(%r,ARR:ct[2]),<0>,<<
  127.                 >>(X,(#f,(#Hd,<0>)/23*23+1):(#Hd,<0>)),)),<>,<<
  128.         >>X(if,(%r,MEM:lst),(^Z),(%Or,MEM:lst)(%r,MEM:lst)),(N,<=>)))) D
  129.     ((if,(#<,<1>,(%r,ARR:ct[1])),t,continue,<<
  130.     >>(#<,(%r,ARR:ct[1]),24),t,repeat,restart)) Y
  131.     ((E)(if,(%r,TTY:<<
  132.     >>A number between <0> and <1> selects<,> Ctrl-C returns to DOS<,>(^MJ)<<
  133.     >>other inputs (Y) the list: ),<:n:><>,(#Dh,<=>),)) V
  134.     [Read choice]
  135.     ((IF,(0 1),<=>,<0>:<1>,<<
  136.         >>(until,(V),(or,<>,(ivl,(#Dh,<0>),(#Dh,<1>))),,(V)))(C)) X
  137.     ((if,(F,<=>),<>,<<
  138.       >>(,(%r,TTY:Not found<,> press (<)return(>) to continue )),<<
  139.       >>(L,<=>)*)) S
  140. )(0 1)(
  141.     ((and,<:g:><>,<0>),(P)(L,(D)));
  142.     ((and,<:g:>,<0>)<1>.HLP<>,(P)(if,(F,<1>.HLP),<>,<<
  143.       >>(,(%r,TTY:Not found<,> press (<)return(>) to continue ))(L,(D)),<<
  144.       >>(L,<=>)));
  145.     (<-->.<>,<=>HLP):
  146.     (<-->.,Illegal name: <=> (^MJ)<<
  147.     >><(>No extension or .HLP extension required<)>);
  148.     (,<=>.HLP):
  149. ))
  150.