home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 601-625 / apd620 / wswhite / examplloader2.amos / examplloader2.amosSourceCode < prev   
AMOS Source Code  |  1986-08-03  |  3KB  |  126 lines

  1. '**** AMOS_PRO Example loader. 2/12/93  W. S. White  
  2. '==============================================
  3. 'The AMOS_PRO help routines dont show working examples,
  4. ' so I coded this to run "Ronnie Simpsons" examples whilst programing.   
  5. 'Open a new window.(This lets you Edit selected example) 
  6. 'Load Exampleloader2 and run.  
  7. ' Note!!!.. R$ contains the path so alter to suit yours. 
  8. '==============================================
  9. Screen Open 1,640,256,4,Hires : Flash Off : Curs Off 
  10. Palette $70,$70,$FFF,$FF0
  11. Dim E(84)
  12. Reserve Zone 84
  13. ST=Start(10)
  14. B$="1,2,21,22,41,42,61,62"
  15. Hide 
  16. Colour Back $70
  17. Cls 
  18. Border 1,2,1
  19. Title Top "....AMOS_PRO Keywords and Example Loader"
  20. Title Bottom "....With AMOS_PRO examples by Ronnie Sinmpson (c) Europress Software"
  21. '========= 
  22. XPOS=1 : YPOS=2
  23. For A=0 To 448
  24.    Locate XPOS,YPOS
  25.    Print Peek$(ST,18)
  26.    Add XPOS,20
  27.    If XPOS>61 : XPOS=1 : Inc YPOS : End If 
  28.    If YPOS=27 or A=448
  29.       Cmove 0,2
  30.       Centre "Press Key or Button to continue"
  31.       Repeat : I$=Inkey$ : MK=Mouse Key : Until I$<>"" or MK=1
  32.       Cls 1,9,9 To 631,247
  33.       XPOS=1 : YPOS=2
  34.    End If 
  35.    Add ST,19
  36. Next 
  37. '========= 
  38. SELECT_KEYWORDS:
  39. Cls 1,9,9 To 631,247
  40. Show 
  41. For A=0 To 84 : E(A)=0 : Next 
  42. _KEYLETTERS
  43. ST=Start(10) : XPOS=1 : YPOS=5 : Pen 2
  44. Text 158,33,"Select first letter of AMOS_PRO Keyword"
  45. Repeat 
  46.    MZ=Mouse Zone
  47.    MK=Mouse Key
  48.    If Not MZ>=1 and MZ<=27 : Cls 1,550,10 To 580,40 : End If 
  49.    If MZ>=1 and MZ<=27 : Gosub BIGGER : End If 
  50. Until MK=1 and MZ>=1 and MZ<=27
  51. If MZ<=26
  52.    I$=Upper$(Chr$(MZ+64))
  53. Else 
  54.    If MZ=27
  55.       I$="="
  56.    End If 
  57. End If 
  58. B=0 : Rem Number of zones/keywords reset to 0 for each screen
  59. For A=0 To 448
  60.    G$=Peek$(ST,18)
  61.    If Mid$(G$,4,1)=I$
  62.       Locate XPOS,YPOS : Print Left$(G$,2); : Pen 3 : Print Mid$(G$,3); : Pen 2
  63.       Inc B
  64.       Set Zone B,(XPOS*8),(YPOS*8) To(XPOS*8)+24,(YPOS*8)+8
  65.       E(B)=Val(Left$(G$,2)) : Rem Store the example No. in E(B)
  66.       Add XPOS,20
  67.    End If 
  68.    If XPOS>61 : XPOS=1 : Inc YPOS : End If 
  69.    Add ST,19 : Rem Advance bank pointer 
  70. Next 
  71. '=== 
  72. SELECT_EXAMPLE:
  73. Pen 3
  74. Locate ,27 : Centre "Left Mouse to select/run Example....Right Mouse for new Keyletter"
  75. Locate ,29 : Centre "EXAMPLE No. SELECTED...."
  76. Repeat 
  77.    MZ=Mouse Zone
  78.    MK=Mouse Key
  79.    Exit If MK=2
  80.    X=X Text(X Screen(X Mouse))
  81.    Y=Y Text(Y Screen(Y Mouse))
  82.    If X>=1 and X<=2 Then P=8
  83.    If X>=21 and X<=22 Then P=168
  84.    If X>=41 and X<=42 Then P=328
  85.    If X>=61 and X<=62 Then P=488
  86.    If MZ>=1 and MZ<=B
  87.       A$=Str$(X)-" "
  88.       If Instr(B$,A$)
  89.          Zoom 1,P,(Y*8),(P+16),(Y*8)+8 To 1,424,224,456,240
  90.       Else Cls 1,424,224 To 456,240
  91.       End If 
  92.    Else Cls 1,424,224 To 456,240
  93.    End If 
  94. Until MK=1 and MZ>=1 and MZ<=B
  95. If MK=2 Then Goto SELECT_KEYWORDS
  96. N$=Str$(E(MZ))-" "
  97. If Len(N$)=1
  98.    O$="H-0/Help_"+N$+".Amos"
  99. Else 
  100.    O$="H-"+Left$(N$,1)+"/Help_"+N$+".Amos"
  101. End If 
  102. R$=("DH1:Amos_Pro/Examples/Examples/"+O$) : Rem ENTER YOUR PATH HERE 
  103. '=================================================================== 
  104. Reserve Zone 
  105. Cls 
  106. Run R$
  107. End 
  108. '============= 
  109. Procedure _KEYLETTERS
  110.    Y=8 : N=65 : A=1
  111.    For X=114 To 510 Step 15
  112.       Ink 3
  113.       Box X,Y To X+12,Y+13
  114.       Set Zone A,X,Y To X+12,Y+13
  115.       Ink 6
  116.       If N=91 Then N=61
  117.       Text X+2,Y+10,Chr$(N)
  118.       Inc N : Inc A
  119.    Next 
  120. End Proc
  121. '======= 
  122. BIGGER:
  123. Y=8
  124. X=114+(MZ-1)*15
  125. Zoom 1,X,Y,X+15,Y+15 To 1,550,10,580,40
  126. Return