home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / educatio / tw31.zip / TWTUT4.CHP < prev    next >
Text File  |  1993-05-25  |  11KB  |  491 lines

  1. %
  2. #EF
  3. #TGETTING ATTENTION
  4. #C2,R5
  5. ~H~bTutorialWriter~N is a ~HTEXT BASED~N program, so the ~HCommands~N operate only in
  6.  
  7. ~HTEXT MODE~N. But that doesn't mean that your screens cannot be made interesting.
  8.  
  9. First, there are a number of ~HCommands~N, all beginning with ~C~I#A~N, which give
  10.  
  11. you access to ~HTEXT BASED~N graphics.
  12.  
  13.  
  14.  
  15. Then there are a group of ~HHighlighting Commands~N which begin with ~C~I#H~N and
  16.  
  17. some ~HNoise Commands~N which begin with ~C~I#N~N.
  18.  
  19.  
  20.  
  21. And we will also cover ~HHyperText~N and a ~HHelp System~N in this ~HChapter~N, with the
  22.  
  23. associated variations on the ~C~I#W~N (Wait) ~HCommand~N.
  24. #W
  25. %
  26. #EF
  27. #T
  28. #C2,R5
  29. Let's start with the ~C~I#A~H Commands~N.
  30.  
  31. Here they are in Summary form :-
  32.  
  33. ~H           #AH,Center,lines                - Huge Robot Box
  34.  
  35.            #AP,Center,lines                - Pointer Box
  36.  
  37.            #AR,Center,lines                - Remember Box
  38.  
  39.            #AL,Lines[,Fore,Back]           - Logo Box
  40.  
  41.            #AC,x1,y1,Fore,Back,message     - Cheering Robot
  42.  
  43.            #AB,lines[,Fore,Back]           - Big letters~N
  44.  
  45.  
  46. When you use these ~HCommands~N, remember to use ~H#D~C~In~N or ~H#W~N to hold the screen
  47. long enough to read!!
  48. #WP
  49. %
  50. #EF
  51. #T
  52. #C1,R9
  53.  #AH,1,9
  54. ~W #AH calls the Huge robot,
  55.  
  56.  1 centers the Text, and
  57.  
  58.  9 reads in the nine lines,
  59.  
  60.  including blank lines, which
  61.  
  62.  follow the command - ~N#AH,1,9
  63.  #W
  64. #WN
  65. #AH,1,9
  66.  #AH calls the Huge robot,
  67.  
  68. 1 centers the Text, and
  69.  
  70. 9 reads in the nine lines,
  71.  
  72. including blank lines, which
  73.  
  74. follow the command - ~N~c#AH,1,9
  75. #WP
  76. %
  77. #EF
  78. #T
  79. #C2,R12
  80.  #AP,1,3
  81. ~W #AP calls the Pointer box, 1 centers
  82.  the text and 3 reads in three lines of
  83.  text - ~N#AP,1,3
  84.  #W
  85. #WN
  86. #AP,1,3
  87.  #AP calls the Pointer box, 1 centers
  88. the text and 3 reads in three lines of
  89. text - ~H#AP,1,3~N
  90. #WP
  91. %
  92. #EF
  93. #T
  94. #C2,R12
  95.  #AR,0,4
  96. ~W #AR calls the Remember box,
  97.  0 says not centered, and 4
  98.  reads in four lines of
  99.  text - ~N#AR,0,4~N
  100.  #W
  101. #W
  102. #AR,0,4
  103.  #AR calls the Remember box,
  104.  0 says not centered, and 4
  105.  reads in four lines of
  106.  text - ~H#AR,0,4~N
  107. #WP
  108. %
  109. #EF
  110. #T
  111. #C2,R12
  112. {#AL,7
  113. ~W #AL calls the logo box which always
  114.  
  115.  centers  the text. 7 reads in seven lines
  116.  
  117.  of text, including the blank lines -
  118.  
  119.  ~N#AL,7
  120.  #W
  121. #WN
  122. #AL,7
  123.  #AL calls the logo box which always
  124.  
  125. centers the text. 7 reads in seven lines
  126.  
  127. of text, including the blank lines -
  128.  
  129. ~H#AL,7~N
  130. #WP
  131. %
  132. #EF
  133. #T
  134. #C2,R5
  135. The ~C~I#AC~H Command~N calls up the ~HCheering Robot~N. ~HIt does not clear the screen
  136.  
  137. like the other ~C~I#A~H Commands~N. The first two numbers after ~C~I#AC~N give the
  138.  
  139. ~C~IColumn~N and ~C~IRow~N position of the robot.  The next two give the ~C~Itext~N and
  140.  
  141. ~C~Ibackground~N colors to be used.  Finally comes the text to be displayed.
  142.  
  143. ~HUse the In-line Commands to set the text color~N.
  144.  
  145.  
  146.  
  147.  
  148. ~H#AC,12,7,13,0,Three little
  149.  
  150. ~H#AC,50,18,15,0,~~r~~Y~~ICheering~~N
  151.  
  152. ~H#AC,60,7,14,0,~~W~~I~~FRobots~~N
  153. #W
  154. #AC,12,7,13,0,Three little
  155. #AC,50,18,15,0,~r~Y~ICheering~N
  156. #AC,60,7,12,0,~W~I~FRobots~N
  157. #EL,25
  158. #WP
  159. %
  160. #EF
  161. #T
  162. #C2,R5
  163. The ~HCommand~C~I #AB,Lines[,Fore,Back]~N puts ~HBig Letters~N on the screen.  The screen
  164.  
  165. can only accept up to ten letters or spaces in any one line, and a maximum
  166.  
  167. of three lines.  The colors can be set by giving values for ~C~IFore~N and ~C~IBack~N,
  168.  
  169. otherwise the default normal colors will be used. Each line is centered on
  170.  
  171. the screen. If ~C~ILines~N has a value of 3 the complete screen is used, with no
  172.  
  173. room for a Title.  If there are less than 3 lines, they will be centered
  174.  
  175. vertically on the screen. Let's look at some examples.
  176.  
  177. ~H#AB,1
  178. HELLO
  179. #SK,S,1
  180. #WN
  181. #AB,1
  182. HELLO
  183. #D5
  184. #SK,R,N,1
  185. #WN
  186. #EL,19
  187. #EL,20
  188. #C2,R19
  189. ~H~K#AB,2,15,1
  190. HELLO
  191. THERE~N~k
  192. #WN
  193. #AB,2,15,1
  194. HELLO
  195. THERE
  196. #D5
  197. #SK,R,N,1
  198. #EL,19
  199. #EL,20
  200. #EL,21
  201. #C2,R19
  202. ~K~H#AB,3,0,7
  203. IS
  204. ANYBODY
  205. LISTENING?~N~k
  206. #WN
  207. #AB,3,0,7
  208. IS
  209. ANYBODY
  210. LISTENING?
  211. #D5
  212. #WP
  213. #SK,D,1
  214. %
  215. #EF
  216. #T
  217. #C2,R7
  218. With ~H~bTutorialWriter~N highlighting is often done using the ~HInline Commands~N
  219.  
  220. which control colors, click-writing and slow-writing.  But there are many
  221.  
  222. other ~HCommands~N available.
  223.  
  224.  
  225.  
  226. ~H#HH,x1,y1,x2,Linetype[,Fore,Back]~N                     Horizontal Line
  227. ~H#HV,x1,y1,y2,Linetype[,Fore,Back]~N                     Vertical Line
  228. ~H#HP,Pointer,Direction,x1,y1[,Fore,Back]~N               Pointers
  229. ~H#HF,x1,y1,x2,y2,n,[,Fore,Back]~N                        Fill Screen
  230. ~H#HS,x1,y1,x2,y2,[,Fore,Back]~N                          Color Screen Section
  231. ~H#NType~N                                                Sounds
  232.  
  233. #WP
  234. %
  235. #EF
  236. #T
  237. #C2,R5
  238. ~H#HH,x1,y1,x2,Linetype[,Fore,Back]~N                     Horizontal Line
  239. ~H#HV,x1,y1,y2,Linetype[,Fore,Back]~N                     Vertical Line
  240.  
  241. These two ~HCommands~N draw lines. ~C~I#HH~N draws a ~HHorizontal~N line from ~HColumn~C~I x1~N to
  242.  
  243. ~HColumn~C~I x2~N on ~HRow ~C~Iy1~N.  ~C~I#HV~N draws a ~HVertical~N line from ~HRow ~C~Iy1~N to ~HRow~C~I y2~N at
  244.  
  245. ~HColumn~C~I x1~N.  ~C~ILinetype~N takes the values of ~H1 for a single line~N and ~H2 for a
  246.  
  247. double line~N. The color of the line can be selected using ~C~IFore~N and ~C~IBack~N. The
  248.  
  249. position of the cursor is not changed, nor are the colors that were being used
  250.  
  251. prior to this ~HCommand~N being implemented.
  252.  
  253. ~H#HH,18,13,72,2,12,0
  254. ~H#HH,18,15,72,1
  255. ~H#HV,18,13,15,1
  256. ~H#HV,72,13,15,2,13,0
  257. #D50
  258. #HH,18,13,72,2,12,0
  259. #D3
  260. #HH,18,15,72,1
  261. #D3
  262. #HV,18,13,15,1
  263. #D3
  264. #HV,72,13,15,2,13,0
  265. #WP
  266. %
  267. #EF
  268. #T
  269. #C2,R5
  270. ~H#HP,Pointer,Direction,x1,y1[,Fore,Back]~N               Pointers
  271.  
  272. This ~HCommand~N allows you to point at specific items on the screen.  ~C~IPointer~N
  273.  
  274. takes the values ~C~IA~N for ~HArrow~N or ~C~IT~N for ~HTriangle~N. ~C~IDirection~N takes the values ~C~IU~N
  275.  
  276. for ~HUp~N, ~C~ID~N for ~HDown~N, ~C~IR~N for ~HRight~N and ~C~IL~N for ~HLeft~N.
  277.  
  278. Let's put a mis-spelled word on the screan, point it out and change it.
  279.  
  280. ~H#HP,T,R,37,13,15,4
  281. ~H#HP,T,L,44,13,15,4
  282. ~H#HP,A,D,42,12,14,4
  283. ~H#HP,A,U,42,14,14,4
  284. ~H#C38,R13
  285. ~H~~Hscreen
  286. #WN
  287. #HP,T,R,37,13,15,4
  288. #D2
  289. #HP,T,L,44,13,15,4
  290. #D2
  291. #HP,A,D,42,12,14,4
  292. #D2
  293. #HP,A,U,42,14,14,4
  294. #D3
  295. #C38,R13
  296. ~Hscreen
  297. #EL,25
  298. #WP
  299. %
  300. #EF
  301. #T
  302. #C2,R5
  303. ~H#HF,x1,y1,x2,y2,n,[,Fore,Back]~N                        Fill Screen
  304. ~H#HS,x1,y1,x2,y2,[,Fore,Back]~N                          Color Screen Section
  305.  
  306. The ~HCommand~C~I #HF~N fills an area of the screen from column ~C~Ix1~N, row ~C~Iy1~N to column
  307.  
  308. ~C~Ix2~N, row ~C~Iy2~N with the ~HASCII Character~N represented by the number ~C~In~N. ~C~IFore~N and
  309.  
  310. ~C~IBack~N select the colors to be used. The ~C~IHELP~N system in ~H~bTutorialWriter~N's ~C~IEditor~N
  311.  
  312. shows a screen of ~HASCII Characters~N and their numbers.
  313. #SK,S,1
  314. #WN
  315. #GT,edithelp
  316. #D20
  317. #GT,ascii help
  318. #EL,25
  319. #WN
  320. #SK,R,N,1
  321. #EL,25
  322. #W
  323. #C2,R16
  324. The ~HCommand~C~I #HS~N colors an area of the screen from ~C~Ix1~N,~C~Iy1~N to ~C~Ix2~N,~C~Iy2~N in the colors
  325.  
  326. ~C~IFore~N and ~C~IBack~N. It does not clear the section - just changes the color!
  327.  
  328. ~H#HS,1,5,80,18,0,2
  329. ~H#D5
  330. ~H#HS,1,5,80,18,14,0
  331. #EL,25
  332. #WN
  333. #HS,1,5,80,18,0,2
  334. #D5
  335. #HS,1,5,80,18,14,0
  336. #SK,D,1
  337. #EL,25
  338. #WP
  339. %
  340. #EF
  341. #T
  342. #C2,R5
  343. Let's look at an example of the use of these two ~HCommands~N.
  344.  
  345. ~H#HF,10,12,70,20,232
  346. ~H#D1
  347. ~H#HS,10,12,70,20,15,1
  348. ~H#D1
  349. ~H#HS,10,12,70,20,1,2
  350. #WN
  351. #HF,10,12,70,20,232
  352. #D1
  353. #HS,10,12,70,20,15,1
  354. #D1
  355. #HS,10,12,70,20,1,2
  356. ~N
  357. #EL,25
  358. #WP
  359. %
  360. #EF
  361. #T
  362. #C2,R5
  363. There are four ~HSound Commands~N. ~C~I#NB~N makes the standard computer ~HBeep~N.  ~C~I#NC~N is
  364.  
  365. a ~Htwo-tone Chime~N.  ~C~I#ND~N is a sound intended to ~HDiscourage~N - the raspberry.
  366.  
  367. And ~C~I#NE~N sounds some pleasant random notes, computer music, intended to be
  368.  
  369. ~HEncouraging~N. Here's what they sound like :
  370.  
  371. #D50
  372. ~H#NB
  373. #NB
  374. #D3
  375.  
  376. ~H#ND
  377. #ND
  378. #D3
  379.  
  380. ~H#NE
  381. #NE
  382. #D3
  383.  
  384. ~H#NC
  385. #NC
  386. #WP
  387. %
  388. #EF
  389. #T
  390. #C2,R5
  391. One ~HInline Command~N we didn't cover which is different from the others is the
  392. #C2,R7
  393. {|
  394. #C4,R7
  395. sign which marks a word or phrase up to 30 characters as a ~HHYPERTEXT Button~N.
  396. #C2,R9
  397. The
  398. #C6,R9
  399. {| sign is placed immediate before and immediately after the word or phrase.
  400. ~H
  401. #C2,R11
  402. {|streptomycin|
  403. ~N
  404. #C18,R11
  405. would appear on screen as a ~HButton~N i.e. black text on a grey
  406. #C2,R13
  407. background.  The information screen which will appear when the ~HButton~N is
  408.  
  409. activated is defined by the ~C~IUtility~N program within the ~HIntegrated Development
  410.  
  411. Environment~N.  Make sure that the screen ~HButton~N word is absolutely identical
  412.  
  413. to the one you define or it will not be recognized.  Up to ten ~HButtons~N can
  414.  
  415. be out on a single screen, and up to 100 for the complete ~M~ITutorial~N. All the
  416.  
  417. ~HButtons~N on a screen become active when the ~C~I#W~N ( ~HContinue Command~N) is used.
  418. #WP
  419. %
  420. #EF
  421. #GT,main menu
  422. #BO,3,4,50,8,7,1,0,2,1,3
  423. To create the HyperText information choose
  424. Utility Programs at the Main Menu.
  425. #EF
  426. #GT,utilities
  427. #EL,25
  428. #BO,3,4,45,8,7,1,0,3,1,3
  429. Then choose HyperText to create a
  430. HYPERTEXT Button.  Here's what the
  431. entry screen looks like.
  432. #EF
  433. #GT,create hyper
  434. #EL,25
  435. #D10
  436. #BO,3,4,42,8,7,1,0,3,1,3
  437. This was the screen I wrote to give
  438. the HYPERTEXT explanation for
  439. CHAPTER in the Structure Diagram.
  440. #WP
  441. %
  442. #EF
  443. #T
  444. #C2,R9
  445. And just to let you test it, here's the Button Word |CHAPTER|. Highlight
  446.  
  447. it using the ~HSpaceBar~N, ~HMouse~N or ~HArrow Keys~N and press ~G~IENTER or the ~G~IMouse
  448.  
  449. Button~N.  Press ~G~IENTER~N or the ~G~IMouse Button~N to remove the information screen.
  450. #WP
  451. %
  452. #EF
  453. #GT,utilities
  454. #BO,3,4,45,8,7,1,0,3,1,3
  455. And now for the HELP SYSTEM. This is
  456. an example only since this Tutorial
  457. does not have a HELP system
  458. #EF
  459. #GT,create help
  460. #EL,25
  461. #D5
  462. #BO,3,14,47,19,7,1,0,4,1,3
  463. Not too difficult, is it?  Test out the
  464. HELP screen we just created by moving
  465. to the Help option at the bottom of the
  466. screen and pressing ENTER or Mouse Button
  467. #WP,H
  468. %
  469. #EF
  470. #T
  471. #C2,R6
  472. Activating the ~HHELP~N System is done through the ~C~I#W~H Command~N, which has a number
  473.  
  474. or variations.
  475.  
  476.  
  477. The ~C~I#W[Switch[,Switch[,Switch] ~HCommand~N is the ~HWait Command~N. Used in the form
  478.  
  479. ~C~I#W~N it will put two ~HMOUSED~N boxes on the screen - ~w~ZCONTINUE~N  and  ~w~ZQUIT~N.
  480.  
  481.  
  482. With or without ~C~ISwitches~N, the ~C~I#W~N Command will make any ~HHYPERTEXT Buttons~N on
  483.  
  484. the current screen active. Adding ~C~IN~N to ~C~I#W~N will suppress the ~w~ZQUIT~N box, and
  485.  
  486. adding ~C~IH~N will make your ~w~ZHELP~N ~HMENU~N active. Adding ~C~IP~N will allow ~w~ZPAGEBACK~N. The
  487.  
  488. ~C~ISwitches~N can be added in any order, but watch the commas - e.g. ~C~I#WH,P,N~N
  489. #WP
  490. #X
  491.