home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / SW2LCALL.ZIP / EXAMPLES / LOADEX.PRG
Encoding:
Text File  |  1990-07-23  |  22.5 KB  |  1,112 lines

  1. * Example for SWBOX()
  2.  
  3. set talk off
  4. startmode = -1
  5. mode      = 4
  6. pause     = 2*18
  7. call spparams with startmode
  8. call spcall with [SWSETVMODE]
  9. startmode = spreturnn
  10. clear
  11. ulx   = 100
  12. uly   = 60
  13. lrx   = 200
  14. lry   = 150
  15. color = 1
  16. fill  = 1
  17. @2,2 say [Enter ULX:  ] get ulx
  18. @3,2 say [Enter ULY:  ] get uly
  19. @4,2 say [Enter LRX:  ] get lrx
  20. @5,2 say [Enter LRY:  ] get lry
  21. @6,2 say [Enter Color:] get color
  22. @7,2 say [Enter Fill: ] get fill
  23. read
  24. call spparams with mode
  25. call spcall with [SWSETVMODE]
  26. call spparams with ulx
  27. call spparams with uly
  28. call spparams with lrx
  29. call spparams with lry
  30. call spparams with color
  31. call spparams with fill
  32. call spcall  with [SWBOX]
  33. call spparams with pause
  34. call spcall  with [SWDELAY]
  35. call spparams with startmode
  36. call spcall  with [SWSETVMODE]
  37.  
  38.  
  39. * Example for SWCIRCLE()
  40.  
  41. set talk off
  42. startmode = -1
  43. mode      = 4
  44. pause     = 2*18
  45. call spparams with startmode
  46. call spcall with [SWSETVMODE]
  47. startmode = spreturnn
  48. clear
  49. ulx   = 100
  50. uly   = 60
  51. lrx   = 200
  52. lry   = 150
  53. color = 1
  54. fill  = 1
  55. @2,2 say [Enter ULX:  ] get ulx
  56. @3,2 say [Enter ULY:  ] get uly
  57. @4,2 say [Enter LRX:  ] get lrx
  58. @5,2 say [Enter LRY:  ] get lry
  59. @6,2 say [Enter Color:] get color
  60. @7,2 say [Enter Fill: ] get fill
  61. read
  62. call spparams with mode
  63. call spcall with [SWSETVMODE]
  64. call spparams with ulx
  65. call spparams with uly
  66. call spparams with lrx
  67. call spparams with lry
  68. call spparams with color
  69. call spparams with fill
  70. call spcall  with [SWBOX]
  71. call spparams with pause
  72. call spcall  with [SWDELAY]
  73. call spparams with startmode
  74. call spcall  with [SWSETVMODE]
  75.  
  76.  
  77. * Example for SWCOATSAY()
  78.  
  79. set talk off
  80. startmode = -1
  81. mode      = 4
  82. pause     = 2*18
  83. call spparams with startmode
  84. call spcall  with [SWSETVMODE]
  85. startmode = spreturnn
  86. clear
  87. row    = 10
  88. column = 0
  89. color  = 1
  90. string = space(40)
  91. @2,2 say [Enter Text:] get string
  92. read
  93. call spparams with mode
  94. call spcall  with [SWSETVMODE]
  95. call spparams with row
  96. call spparams with column
  97. call spparams with color
  98. call spparams with string
  99. call spcall  with [SWCOATSAY]
  100. call spparams with pause
  101. call spcall  with [SWDELAY]
  102. call spparams with startmode
  103. call spcall  with [SWSETVMODE]
  104.  
  105.  
  106. * Example for SWCOGET()
  107.  
  108. set talk off
  109. startmode = -1
  110. mode      = 4
  111. call spparams with startmode
  112. call spcall with [SWSETVMODE]
  113. startmode = spreturnn
  114. atsayrow = 5
  115. atsaycol = 1
  116. atsaycolor = 3
  117. atsaystring = "Enter Social Security #:"
  118. exitkey = 0
  119. getstatus = 0
  120. getrow = 5
  121. getcol = 27
  122. getlen = 11
  123. gettxtc = 2
  124. getcurc = 3
  125. getcurin = 1
  126. call spparams with mode
  127. call spcall with [SWSETVMODE]
  128. call spparams with atsayrow
  129. call spparams with atsaycol
  130. call spparams with atsaycolor
  131. call spparams with atsaystring
  132. call spcall with [SWCOATSAY]
  133. call spparams with getrow
  134. call spparams with getcol
  135. call spparams with getlen
  136. call spparams with gettxtc
  137. call spparams with getcurc
  138. call spparams with getcurin
  139. call spcall with [SWCOGET]
  140. usrinput = spreturnc
  141. call spcall with [SWCOGETER]
  142. getstatus = spreturnn
  143. call spcall with [SWCOGETXIT]
  144. exitkey = spreturnn
  145. call spparams with startmode
  146. call spcall with [SWSETVMODE]
  147. set talk on
  148. if(getstatus>=0)
  149.   ?usrinput
  150.   ?"Length of input string = ",getstatus
  151.   ?"Code for key that caused exit = ",exitkey
  152. else
  153.   ?"swcoget() returned "+str(getstatus,3,0)
  154. endif
  155.  
  156.  
  157. * Example for SWCOGETER()
  158.  
  159. set talk off
  160. startmode = -1
  161. mode      = 4
  162. call spparams with startmode
  163. call spcall with [SWSETVMODE]
  164. startmode = spreturnn
  165. atsayrow = 5
  166. atsaycol = 1
  167. atsaycolor = 3
  168. atsaystring = "Enter Social Security #:"
  169. exitkey = 0
  170. getstatus = 0
  171. getrow = 5
  172. getcol = 27
  173. getlen = 11
  174. gettxtc = 2
  175. getcurc = 3
  176. getcurin = 1
  177. call spparams with mode
  178. call spcall with [SWSETVMODE]
  179. call spparams with atsayrow
  180. call spparams with atsaycol
  181. call spparams with atsaycolor
  182. call spparams with atsaystring
  183. call spcall with [SWCOATSAY]
  184. call spparams with getrow
  185. call spparams with getcol
  186. call spparams with getlen
  187. call spparams with gettxtc
  188. call spparams with getcurc
  189. call spparams with getcurin
  190. call spcall with [SWCOGET]
  191. usrinput = spreturnc
  192. call spcall with [SWCOGETER]
  193. getstatus = spreturnn
  194. call spcall with [SWCOGETXIT]
  195. exitkey = spreturnn
  196. call spparams with startmode
  197. call spcall with [SWSETVMODE]
  198. set talk on
  199. if(getstatus>=0)
  200.   ?usrinput
  201.   ?"Length of input string = ",getstatus
  202.   ?"Code for key that caused exit = ",exitkey
  203. else
  204.   ?"swcoget() returned "+str(getstatus,3,0)
  205. endif
  206.  
  207.  
  208. * Example for SWCOGETXIT()
  209.  
  210. set talk off
  211. startmode = -1
  212. mode      = 4
  213. call spparams with startmode
  214. call spcall with [SWSETVMODE]
  215. startmode = spreturnn
  216. atsayrow = 5
  217. atsaycol = 1
  218. atsaycolor = 3
  219. atsaystring = "Enter Social Security #:"
  220. exitkey = 0
  221. getstatus = 0
  222. getrow = 5
  223. getcol = 27
  224. getlen = 11
  225. gettxtc = 2
  226. getcurc = 3
  227. getcurin = 1
  228. call spparams with mode
  229. call spcall with [SWSETVMODE]
  230. call spparams with atsayrow
  231. call spparams with atsaycol
  232. call spparams with atsaycolor
  233. call spparams with atsaystring
  234. call spcall with [SWCOATSAY]
  235. call spparams with getrow
  236. call spparams with getcol
  237. call spparams with getlen
  238. call spparams with gettxtc
  239. call spparams with getcurc
  240. call spparams with getcurin
  241. call spcall with [SWCOGET]
  242. usrinput = spreturnc
  243. call spcall with [SWCOGETER]
  244. getstatus = spreturnn
  245. call spcall with [SWCOGETXIT]
  246. exitkey = spreturnn
  247. call spparams with startmode
  248. call spcall with [SWSETVMODE]
  249. set talk on
  250. if(getstatus>=0)
  251.   ?usrinput
  252.   ?"Length of input string = ",getstatus
  253.   ?"Code for key that caused exit = ",exitkey
  254. else
  255.   ?"swcoget() returned "+str(getstatus,3,0)
  256. endif
  257.  
  258.  
  259. * Example for SWDELAY()
  260.  
  261. set talk off
  262. clear
  263. ?[Delaying 1 Second]
  264. ?
  265. pause = 1*18
  266. call spparams with pause
  267. call spcall  with [SWDELAY]
  268. ?[Delaying 2 Seconds]
  269. ?
  270. pause = 2*18
  271. call spparams with pause
  272. call spcall  with [SWDELAY]
  273. ?[Delaying 3 Seconds]
  274. pause = 3*18
  275. call spparams with pause
  276. call spcall  with [SWDELAY]
  277.  
  278. * Example for SWFORSOUND()
  279.  
  280. set talk off
  281. i       = 1
  282. mode0   = 0
  283. mode1   = 1
  284. start   = 200
  285. end     = 1500
  286. posinc  = 10
  287. neginc  = -10
  288. loopcnt = 130
  289. dur     = 500
  290. call spparams with mode1
  291. call spcall  with [SWSETSOUND]
  292. do while i < 6
  293.    call spparams with start
  294.    call spparams with posinc
  295.    call spparams with loopcnt
  296.    call spparams with dur
  297.    call spcall  with [SWFORSOUND]
  298.    call spparams with end
  299.    call spparams with neginc
  300.    call spparams with loopcnt
  301.    call spparams with dur
  302.    call spcall  with [SWFORSOUND]
  303.    i = i + 1
  304. enddo
  305. call spparams with mode0
  306. call spcall  with [SWSETSOUND]
  307. wait
  308.  
  309. * Example for SWGCLS()
  310.  
  311. set talk off
  312. startmode = -1
  313. mode      = 4
  314. pause     = 2*18
  315. call spparams with startmode
  316. call spcall  with [SWSETVMODE]
  317. startmode = spreturnn
  318. call spparams with mode
  319. call spcall  with [SWSETVMODE]
  320. call spcall  with [SWGCLS]
  321. call spparams with startmode
  322. call spcall  with [SWSETVMODE]
  323.  
  324.  
  325. * Example for SWGETABORT()
  326.  
  327. * Set F1 key to abort SWCOGET()
  328. *
  329. abortkey = 15104
  330. set talk off
  331. startmode = -1
  332. mode      = 4
  333. call spparams with startmode
  334. call spcall with [SWSETVMODE]
  335. startmode = spreturnn
  336. atsayrow = 5
  337. atsaycol = 1
  338. atsaycolor = 3
  339. atsaystring = "Enter Social Security #:"
  340. exitkey = 0
  341. getstatus = 0
  342. getrow = 5
  343. getcol = 27
  344. getlen = 11
  345. gettxtc = 2
  346. getcurc = 3
  347. getcurin = 1
  348. call spparams with mode
  349. call spcall with [SWSETVMODE]
  350. call spparams with atsayrow
  351. call spparams with atsaycol
  352. call spparams with atsaycolor
  353. call spparams with atsaystring
  354. call spcall with [SWCOATSAY]
  355. call spparams with abortkey
  356. call spcall with [SWGETABORT]
  357. call spparams with getrow
  358. call spparams with getcol
  359. call spparams with getlen
  360. call spparams with gettxtc
  361. call spparams with getcurc
  362. call spparams with getcurin
  363. call spcall with [SWCOGET]
  364. usrinput = spreturnc
  365. call spcall with [SWCOGETER]
  366. getstatus = spreturnn
  367. call spcall with [SWCOGETXIT]
  368. exitkey = spreturnn
  369. call spparams with startmode
  370. call spcall with [SWSETVMODE]
  371. set talk on
  372. if(getstatus>=0)
  373.   ?usrinput
  374.   ?"Length of input string = ",getstatus
  375.   ?"Code for key that caused exit = ",exitkey
  376.   if(exitkey=abortkey)
  377.     ?"F1 Key Pressed to exit."
  378.   endif
  379. else
  380.   ?"swcoget() returned "+str(getstatus,3,0)
  381. endif
  382.  
  383. * Example for SWGETMAXC()
  384.  
  385. set talk off
  386. startmode = -1
  387. mode      = 4
  388. pause     = 2*18
  389. call spparams with startmode
  390. call spcall with [SVSETMODE]
  391. startmode = spreturnn
  392. call spparams with mode
  393. call spcall with [SWSETVMODE]
  394. call spcall with [SWGETMAXC]
  395. maxc4 = spreturnn
  396. mode = 6
  397. call spparams with mode
  398. call spcall with [SWSETVMODE]
  399. call spcall with [SWGETMAXC]
  400. maxc6 = spreturnn
  401. call spparams with startmode
  402. call spcall with [SWSETVMODE]
  403. ?[Max color for mode 4: ]+str(maxc4,3,0)
  404. ?
  405. ?[Max color for mode 6: ]+str(maxc6,3,0)
  406. ?
  407. wait
  408.  
  409.  
  410. * Example for SWGETMAXX()
  411.  
  412. set talk off
  413. startmode = -1
  414. mode      = 4
  415. pause     = 2*18
  416. call spparams with startmode
  417. call spcall  with [SWSETVMODE]
  418. startmode = spreturnn
  419. call spparams with mode
  420. call spcall  with [SWSETVMODE]
  421. call spcall  with [SWGETMAXX]
  422. max4 = spreturnn
  423. call spcall  with [SWGETMAXY]
  424. may4 = spreturnn
  425. mode = 6
  426. call spparams with mode
  427. call spcall  with [SWSETVMODE]
  428. call spcall  with [SWGETMAXX]
  429. max6 = spreturnn
  430. call spcall  with [SWGETMAXY]
  431. may6 = spreturnn
  432. call spparams with startmode
  433. call spcall  with [SWSETVMODE]
  434. ?[Max x vmode = 4: ]+str(max4,3,0)
  435. ?[Max y vmode = 4: ]+str(may4,3,0)
  436. ?
  437. ?[Max x vmode = 6: ]+str(max6,3,0)
  438. ?[Max y vmode = 6: ]+str(may6,3,0)
  439. ?
  440. wait
  441.  
  442.  
  443. * Example for SWGETMAXY()
  444.  
  445.  
  446. set talk off
  447. startmode = -1
  448. mode      = 4
  449. pause     = 2*18
  450. call spparams with startmode
  451. call spcall  with [SWSETVMODE]
  452. startmode = spreturnn
  453. call spparams with mode
  454. call spcall  with [SWSETVMODE]
  455. call spcall  with [SWGETMAXX]
  456. max4 = spreturnn
  457. call spcall  with [SWGETMAXY]
  458. may4 = spreturnn
  459. mode = 6
  460. call spparams with mode
  461. call spcall  with [SWSETVMODE]
  462. call spcall  with [SWGETMAXX]
  463. max6 = spreturnn
  464. call spcall  with [SWGETMAXY]
  465. may6 = spreturnn
  466. call spparams with startmode
  467. call spcall  with [SWSETVMODE]
  468. ?[Max x vmode = 4: ]+str(max4,3,0)
  469. ?[Max y vmode = 4: ]+str(may4,3,0)
  470. ?
  471. ?[Max x vmode = 6: ]+str(max6,3,0)
  472. ?[Max y vmode = 6: ]+str(may6,3,0)
  473. ?
  474. wait
  475.  
  476.  
  477. * Example for SWGETVMODE()
  478.  
  479. clear
  480. call spcall  with [SWGETVMODE]
  481. ?[Video mode is set to: ]+str(spreturnn,1,0)
  482. wait
  483.  
  484.  
  485. * Example for SWGETXORV()
  486.  
  487. set talk off
  488. startmode = -1
  489. pause     = 2*18
  490. call spparams with startmode
  491. call spcall with [SWSETVMODE]
  492. startmode = spreturnn
  493. row       = 2
  494. column    = 2
  495. color     = 1
  496. mode      = 19
  497. call spparams with mode
  498. call spcall with [SWSETVMODE]
  499. call spcall with [SWSETXORV]
  500. xorval = spreturn
  501. string = [XOR vale = ]+str(xorval,3,0)
  502. call spparams with row
  503. call spparams with column
  504. call spparams with color
  505. call spparams with string
  506. call spcall with [SWCOATSAY]
  507. call spparams with pause
  508. call spcall with [SWDELAY]
  509. call spparams with startmode
  510. call spcall with [SWSETVMODE]
  511.  
  512.  
  513. * Example for SWISEGA()
  514.  
  515. set talk off
  516. startmode = -1
  517. pause     = 2*18
  518. call spparams with startmode
  519. call spcall with [SWSETVMODE]
  520. startmode = spreturnn
  521. row       = 2
  522. column    = 2
  523. color     = 1
  524. ism       = .F.
  525. string = [Mode set to EGA]
  526. call spcall with [SWISEGA]
  527. ism = spreturn1
  528. if ism
  529.    mode = 16
  530.    call spparams with mode
  531.    call spcall with [SWSETVMODE]
  532.    call spparams with row
  533.    call spparams with column
  534.    call spparams with color
  535.    call spparams with string
  536.    call spcall with [SWCOATSAY]
  537.    call spparams with pause
  538.    call spcall with [SWDELAY]
  539. else
  540.    ?[EGA not detected]
  541. endif
  542. call spparams with pause
  543. call spcall with [SWDELAY]
  544. call spparams with startmode
  545. call spcall with [SWSETVMODE]
  546.  
  547.  
  548. * Example for SWISHERC()
  549.  
  550. set talk off
  551. startmode = -1
  552. pause     = 2*18
  553. call spparams with startmode
  554. call spcall with [SWSETVMODE]
  555. startmode = spreturnn
  556. row       = 2
  557. column    = 2
  558. color     = 1
  559. ism       = .F.
  560. string = [Mode set to HERC]
  561. call spcall with [SWISHERC]
  562. ism = spreturn1
  563. if ism
  564.    mode = 16
  565.    call spparams with mode
  566.    call spcall with [SWSETVMODE]
  567.    call spparams with row
  568.    call spparams with column
  569.    call spparams with color
  570.    call spparams with string
  571.    call spcall with [SWCOATSAY]
  572.    call spparams with pause
  573.    call spcall with [SWDELAY]
  574. else
  575.    ?[HERC not detected]
  576. endif
  577. call spparams with pause
  578. call spcall with [SWDELAY]
  579. call spparams with startmode
  580. call spcall with [SWSETVMODE]
  581.  
  582.  
  583. * Example for SWISVGA()
  584.  
  585. set talk off
  586. startmode = -1
  587. pause     = 2*18
  588. call spparams with startmode
  589. call spcall with [SWSETVMODE]
  590. startmode = spreturnn
  591. row       = 2
  592. column    = 2
  593. color     = 1
  594. ism       = .F.
  595. string = [Mode set to VGA]
  596. call spcall with [SWISVGA]
  597. ism = spreturn1
  598. if ism
  599.    mode = 16
  600.    call spparams with mode
  601.    call spcall with [SWSETVMODE]
  602.    call spparams with row
  603.    call spparams with column
  604.    call spparams with color
  605.    call spparams with string
  606.    call spcall with [SWCOATSAY]
  607.    call spparams with pause
  608.    call spcall with [SWDELAY]
  609. else
  610.    ?[VGA not detected]
  611. endif
  612. call spparams with pause
  613. call spcall with [SWDELAY]
  614. call spparams with startmode
  615. call spcall with [SWSETVMODE]
  616.  
  617.  
  618. * Example for SWLINE()
  619.  
  620.  
  621. set talk off
  622. startmode = -1
  623. mode      = 4
  624. pause     = 2*18
  625. call spparams with startmode
  626. call spcall  with [SWSETVMODE]
  627. startmode = spreturnn
  628. call spparams with mode
  629. call spcall  with [SWSETVMODE]
  630. x1    = 0
  631. y1    = 0
  632. x2    = 319
  633. y2    = 199
  634. color = 1+128
  635. c     = 1
  636. do  while x1 <= 319
  637.     call spparams with x1
  638.     call spparams with y1
  639.     call spparams with x2
  640.     call spparams with y2
  641.     call spparams with color
  642.     call spcall  with [SWLINE]
  643.     x2=x2-1
  644.     x1 = x1 + 1
  645. enddo
  646. call spparams with pause
  647. call spcall  with [SWDELAY]
  648. call spparams with startmode
  649. call spcall  with [SWSETVMODE]
  650.  
  651.  
  652. * Example for SWLINETO()
  653.  
  654. set talk off
  655. startmode = -1
  656. mode      = 4
  657. pause     = 2*18
  658. call spparams with startmode
  659. call spcall  with [SWSETVMODE]
  660. startmode = spreturnn
  661. call spparams with mode
  662. call spcall  with [SWSETVMODE]
  663. x     = 0
  664. y     = 0
  665. color = 1
  666. call spparams with x
  667. call spparams with y
  668. call spcall  with [SWSETORIGN]
  669. x = 300
  670. y = 90
  671. call spparams with x
  672. call spparams with y
  673. call spparams with color
  674. call spcall  with [SWLINETO]
  675. x = 120
  676. y = 199
  677. call spparams with x
  678. call spparams with y
  679. call spparams with color
  680. call spcall  with [SWLINETO]
  681. call spparams with pause
  682. call spcall  with [SWDELAY]
  683. call spparams with startmode
  684. call spcall  with [SWSETVMODE]
  685.  
  686.  
  687. * Example for SWPAINTREV()
  688.  
  689.  
  690. clear
  691. call spcall with [SWPAINTVER]
  692. ver = spreturnn
  693. call spcall with [SWPAINTREV]
  694. rev = spreturnn
  695. if  rev < 10
  696.     version = str(ver,2,0)+[.0]+str(rev,1,0)
  697. else
  698.     version = str(ver,2,0)+[.]+str(rev,2,0)
  699. endif
  700. ?[Version: ]+version
  701. wait
  702.  
  703.  
  704. * Example for SWPAINTVER()
  705.  
  706. clear
  707. call spcall with [SWPAINTVER]
  708. ver = spreturnn
  709. call spcall with [SWPAINTREV]
  710. rev = spreturnn
  711. if  rev < 10
  712.     version = str(ver,2,0)+[.0]+str(rev,1,0)
  713. else
  714.     version = str(ver,2,0)+[.]+str(rev,2,0)
  715. endif
  716. ?[Version: ]+version
  717. wait
  718.  
  719.  
  720. * Example for SWPALETTE()
  721.  
  722. set talk off
  723. startmode = -1
  724. mode      = 4
  725. pause     = 2*18
  726. one       = 1
  727. zero      = 0
  728. call spparams with startmode
  729. call spcall  with [SWSETVMODE]
  730. startmode = spreturnn
  731. call spparams with mode
  732. call spcall  with [SWSETVMODE]
  733. call spparams with one
  734. call spparams with one
  735. call spcall  with [SWPALETTE]
  736. call spparams with one
  737. call spparams with zero
  738. call spcall  with [SWPALETTE]
  739. cid   = 0
  740. ulx   = 100
  741. uly   = 60
  742. lrx   = 200
  743. lry   = 150
  744. color = 1
  745. fill  = 1
  746. call spparams with ulx
  747. call spparams with uly
  748. call spparams with lrx
  749. call spparams with lry
  750. call spparams with color
  751. call spparams with fill
  752. call spcall  with [SWBOX]
  753. i         = 2
  754. looppause = 9
  755. do  while i <= 16
  756.     call spparams with cid
  757.     call spparams with i
  758.     call spcall  with [SWPALETTE]
  759.     i = i + 1
  760.     call spparams with looppause
  761.     call spcall  with [SWDELAY]
  762. enddo
  763. call spparams with pause
  764. call spcall  with [SWDELAY]
  765. call spparams with startmode
  766. call spcall  with [SWSETVMODE]
  767.  
  768.  
  769. * Example for SWPOPSLIDE()
  770.  
  771. set talk off
  772. startmode = -1
  773. dfile     = [d1.pcx]
  774. mode      = 4
  775. pause     = 2*18
  776. call spparams with startmode
  777. call spcall  with [SWSETVMODE]
  778. startmode = spreturnn
  779. call spparams with mode
  780. call spcall  with [SWSETVMODE]
  781. call spparams with dfile
  782. call spcall  with [SWPOPSLIDE]
  783. call spparams with pause
  784. call spcall  with [SWDELAY]
  785. call spparams with startmode
  786. call spcall  with [SWSETVMODE]
  787.  
  788.  
  789. * Example for SWPRTSCRN()
  790.  
  791. set talk off
  792. startmode = -1
  793. dfile     = [d1.pcx]
  794. mode      = 4
  795. pause     = 2*18
  796. call spparams with startmode
  797. call spcall  with [SWSETVMODE]
  798. startmode = spreturnn
  799. call spparams with mode
  800. call spcall  with [SWSETVMODE]
  801. call spparams with dfile
  802. call spcall  with [SWPOPSLIDE]
  803. call spcall  with [SWPRTSCRN]
  804. call spparams with pause
  805. call spcall  with [SWDELAY]
  806. call spparams with startmode
  807. call spcall  with [SWSETVMODE]
  808.  
  809.  
  810. * Example for SWQDELAY()
  811.  
  812. i    = 500
  813. hold = 10
  814. do while i < 1000
  815.    call spparams with i
  816.    call spcall  with [SWSOUNDON]
  817.    call spparams with hold
  818.    call spcall  with [SWQDELAY]
  819.    i = i + 10
  820. enddo
  821. call spcall  with [SWSOUNDOFF]
  822.  
  823.  
  824. * Example for SWRAND()
  825.  
  826. rand = 1
  827. i    = 1
  828. call spparams with rand
  829. call spcall  with [SWSRAND]
  830. do  while i < 10
  831.     call spcall  with [SWRAND]
  832.     rand = spreturnn
  833.     ?i,rand
  834.    i = i + 1
  835. enddo
  836.  
  837.  
  838. * Example for SWREADDOT()
  839.  
  840. set talk off
  841. startmode = -1
  842. mode      = 4
  843. pause     = 2*18
  844. call spparams with startmode
  845. call spcall  with [SWSETVMODE]
  846. startmode = spreturnn
  847. call spparams with mode
  848. call spcall  with [SWSETVMODE]
  849. row    = 10
  850. column = 0
  851. color  = 1
  852. x      = 100
  853. y      = 100
  854. call spparams with x
  855. call spparams with y
  856. call spparams with color
  857. call spcall  with [SWWRITEDOT]
  858. call spparams with x
  859. call spparams with y
  860. call spcall  with [SWREADDOT]
  861. dot    = spreturnn
  862. string = [Attribute Value of x = 100, y = 100
  863. :]+str(dot,3,0)
  864. call spparams with row
  865. call spparams with column
  866. call spparams with color
  867. call spparams with string
  868. call spcall  with [SWCOATSAY]
  869. call spparams with pause
  870. call spcall  with [SWDELAY]
  871. call spparams with startmode
  872. call spcall  with [SWSETVMODE]
  873.  
  874.  
  875. * Example for SWSETORIGN()
  876.  
  877. set talk off
  878. startmode = -1
  879. mode      = 4
  880. pause     = 2*18
  881. call spparams with startmode
  882. call spcall  with [SWSETVMODE]
  883. startmode = spreturnn
  884. call spparams with mode
  885. call spcall  with [SWSETVMODE]
  886. x     = 0
  887. y     = 0
  888. color = 1
  889. call spparams with x
  890. call spparams with y
  891. call spcall  with [SWSETORIGN]
  892. x = 300
  893. y = 90
  894. call spparams with x
  895. call spparams with y
  896. call spparams with color
  897. call spcall  with [SWLINETO]
  898. x = 120
  899. y = 199
  900. call spparams with x
  901. call spparams with y
  902. call spparams with color
  903. call spcall  with [SWLINETO]
  904. call spparams with pause
  905. call spcall  with [SWDELAY]
  906. call spparams with startmode
  907. call spcall  with [SWSETVMODE]
  908.  
  909.  
  910. * Example for SWSETPOPXY()
  911.  
  912. set talk off
  913. startmode = -1
  914. dfile     = [d1.pcx]
  915. mode      = 4
  916. pause     = 2*18
  917. ulx       = 20
  918. uly       = 20
  919. lrx       = 120
  920. lry       = 120
  921. popopt      = 0
  922. call spparams with startmode
  923. call spcall  with [SWSETVMODE]
  924. startmode = spreturnn
  925. call spparams with mode
  926. call spcall  with [SWSETVMODE]
  927. call spparams with popopt
  928. call spcall with [SWSETVMPOP]
  929. call spparams with ulx
  930. call spparams with uly
  931. call spparams with lrx
  932. call spparams with lry
  933. call spcall with [SWSETPOPXY]
  934. call spparams with dfile
  935. call spcall  with [SWPOPSLIDE]
  936. call spparams with pause
  937. call spcall  with [SWDELAY]
  938. call spparams with startmode
  939. call spcall  with [SWSETVMODE]
  940.  
  941.  
  942. * Example for SWSETSOUND()
  943.  
  944. set talk off
  945. i       = 1
  946. mode0   = 0
  947. mode1   = 1
  948. start   = 200
  949. end     = 1500
  950. posinc  = 10
  951. neginc  = -10
  952. loopcnt = 130
  953. dur     = 500
  954. call spparams with mode1
  955. call spcall  with [SWSETSOUND]
  956. do while i < 6
  957.    call spparams with start
  958.    call spparams with posinc
  959.    call spparams with loopcnt
  960.    call spparams with dur
  961.    call spcall  with [SWFORSOUND]
  962.    call spparams with end
  963.    call spparams with neginc
  964.    call spparams with loopcnt
  965.    call spparams with dur
  966.    call spcall  with [SWFORSOUND]
  967.    i = i + 1
  968. enddo
  969. call spparams with mode0
  970. call spcall  with [SWSETSOUND]
  971. wait
  972.  
  973. * Example for SWSETVMODE()
  974.  
  975. set talk off
  976. startmode = -1
  977. mode      = 4
  978. call spparams with startmode
  979. call spcall  with [SWSETVMODE]
  980. startmode = spreturnn
  981. call spparams with mode
  982. call spcall  with [SWSETVMODE]
  983. call spparams with startmode
  984. call spcall  with [SWSETVMODE]
  985.  
  986.  
  987. * Example for SWSETVMPOP()
  988.  
  989.  
  990. set talk off
  991. startmode = -1
  992. dfile     = [d1.pcx]
  993. mode      = 4
  994. pause     = 2*18
  995. ulx       = 20
  996. uly       = 20
  997. lrx       = 120
  998. lry       = 120
  999. popopt      = 0
  1000. call spparams with startmode
  1001. call spcall  with [SWSETVMODE]
  1002. startmode = spreturnn
  1003. call spparams with mode
  1004. call spcall  with [SWSETVMODE]
  1005. call spparams with popopt
  1006. call spcall with [SWSETVMPOP]
  1007. call spparams with ulx
  1008. call spparams with uly
  1009. call spparams with lrx
  1010. call spparams with lry
  1011. call spcall with [SWSETPOPXY]
  1012. call spparams with dfile
  1013. call spcall  with [SWPOPSLIDE]
  1014. call spparams with pause
  1015. call spcall  with [SWDELAY]
  1016. call spparams with startmode
  1017. call spcall  with [SWSETVMODE]
  1018.  
  1019.  
  1020. * Example for SWSOUND()
  1021.  
  1022. pause = 1
  1023. color = 2
  1024. x     = 0
  1025. y     = 0
  1026. i     = 1
  1027. call spparams with i
  1028. call spcall  with [SWSRAND]
  1029. do  while i < 100
  1030.     call spcall  with [SWRAND]
  1031.     x = mod(spreturnn,1999)
  1032.     if x > 32
  1033.        call spparams with x
  1034.        call spparams with pause
  1035.        call spcall  with [SWSOUND]
  1036.     endif
  1037.     i = i + 1
  1038. enddo
  1039.  
  1040.  
  1041. * Example for SWSOUNDOFF()
  1042.  
  1043.  
  1044. i    = 500
  1045. hold = 10
  1046. do while i < 1000
  1047.    call spparams with i
  1048.    call spcall  with [SWSOUNDON]
  1049.    call spparams with hold
  1050.    call spcall  with [SWQDELAY]
  1051.    i = i + 10
  1052. enddo
  1053. call spcall  with [SWSOUNDOFF]
  1054.  
  1055.  
  1056. * Example for SWSOUNDON()
  1057.  
  1058. i    = 500
  1059. hold = 10
  1060. do while i < 1000
  1061.    call spparams with i
  1062.    call spcall  with [SWSOUNDON]
  1063.    call spparams with hold
  1064.    call spcall  with [SWQDELAY]
  1065.    i = i + 10
  1066. enddo
  1067. call spcall  with [SWSOUNDOFF]
  1068.  
  1069. * Example for SWSOUNDOFF()
  1070.  
  1071. rand = 1
  1072. i    = 1
  1073. call spparams with rand
  1074. call spcall  with [SWSRAND]
  1075. do  while i < 10
  1076.     call spcall  with [SWRAND]
  1077.     rand = spreturnn
  1078.     ?i,rand
  1079.     i = i + 1
  1080. enddo
  1081.  
  1082.  
  1083. * Example SWWRITEDOT()
  1084.  
  1085. set talk off
  1086. startmode = -1
  1087. mode      = 4
  1088. pause     = 2*18
  1089. color     = 1
  1090. call spparams with startmode
  1091. call spcall  with [SWSETVMODE]
  1092. startmode = spreturnn
  1093. call spparams with mode
  1094. call spcall  with [SWSETVMODE]
  1095. i = 1
  1096. call spparams with i
  1097. call spcall  with [SWSRAND]
  1098. do while i < 200
  1099.    call spcall  with [SWRAND]
  1100.    x = mod(spreturnn,319)
  1101.    call spcall  with [SWRAND]
  1102.    y = mod(spreturnn,199)
  1103.    call spparams with x
  1104.    call spparams with y
  1105.    call spparams with color
  1106.    call spcall  with [SWWRITEDOT]
  1107.    i = i + 1
  1108. enddo
  1109. call spparams with startmode
  1110. call spcall  with [SWSETVMODE]
  1111. !seealso: SWREADDOT()
  1112.