home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / totallyamos / issue4 / programming / 9.seq < prev   
Encoding:
Text File  |  1992-05-13  |  5.9 KB  |  180 lines

  1. fff00000ff00fe0080001a7f
  2. ^4*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF
  3.  
  4. ^2                      T O T A L L Y   A M A L 
  5.  
  6. ^1                            By Paul Townsend
  7.  
  8. ^5                       Of Technical Fred Software
  9.  
  10. ^4*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF
  11.  
  12. ^2                     So you want to learn Amal ?
  13.  
  14. ^3                               Sure ?
  15.  
  16. ^7                       In that case read on !
  17.  
  18. ^4*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF
  19.  
  20. ^1                           The Very Beginings
  21.  
  22. ^6 It  seems  that  there  are a lot of people out there who seem to be
  23. ^6getting  the  hang of Amos Basic, but seem to be having difficulty in
  24. ^6using  Amal,  this short tuturial aims to get those people started at
  25. ^6writing simple programs in Amal.
  26.  
  27. ^6 This tutorial has no intentions of teaching you to program in BASIC,
  28. ^6there are enougth books on that already.
  29.  
  30. ^6 I do not think that I am any expert with Amal ( At least not yet !),
  31. ^6I  am  still  getting to grips with some of it's finer details, but I
  32. ^6will try to tell you what little I know in a bit more detail and in a
  33. ^6more understandable way than the Amos manual.
  34.  
  35. ^6 Right that's enough waffle, let's get down to business.
  36.  
  37. ^6 First  I will out line a couple of rules that you must always follow
  38. ^6when using Amal.
  39.  
  40. ^1                               Rule 1
  41.  
  42. ^4This is the one mistake that many new users seem to make,
  43.  
  44. ^2            A M A L   I S   C A S E   S E N S I T I V E 
  45.  
  46. ^4 That  means  that  it  is VERY fussy when it comes down to giving it
  47. ^4commands, you may have noticed that whenever you type in a command in
  48. ^4normal  Amos,  it noes not matter whether you use UPPER case (Capital
  49. ^4letters eg.'ABCD') or lower case letters (small letters eg.  'abcd'),
  50. ^4for  example  take  the  "Print"  command,  Amos does not care if you
  51. ^4type:-
  52.  
  53. ^2PRINT
  54.  
  55. ^2print
  56.  
  57. ^2Print
  58.  
  59. ^4or even :-
  60.  
  61. ^2PrInT
  62.  
  63. ^4It always seems to understand and convert it to :-
  64.  
  65. ^2Print (i.e.  the first letter is Captal, the rest are not !)
  66.  
  67. ^4 You  may  be  forgiven  for  thinking  that  Amal  would  be just as
  68. ^4carefree,  well  sorry  to  disappoint  you, but Amal is nowhere near
  69. ^4being that helpful
  70.  
  71. ^4If you mean,
  72.  
  73. ^2For X=1 To 100 ; Pause ; Next X
  74.  
  75. ^4then that is what you must type in to Amal, it's no good saying,
  76.  
  77. ^2For X=1 to 100 ; Pause ; Next X
  78.  
  79. ^4because it just will not work
  80.  
  81. ^6Spot  the  difference?
  82.  
  83. ^1 Yes  there  is  one,  look  carefully,  the  word 'to' in the second
  84. ^1example  should be 'To' not 'to', you see what a headache Amal can be
  85. ^1to it's newcommers.
  86.  
  87. ^1 Don't  worry  if  you  don't  understand  what the last line of Amal
  88. ^1commands  meant, all will be revealed later, as long as you can see
  89. ^1the  difference between them, then you are over one of the first Amal
  90. ^1hurdles.
  91.  
  92. ^7                               Rule 2
  93.  
  94. ^2Colons (:) in Amal
  95.  
  96. ^6 When  programming  in  BASIC  you  may be used to using the colon to
  97. ^6seperate  commands  that  you  want  to  stay  on  the  same line for
  98. ^6example:-
  99.  
  100. ^2For F=1 To 100 :  Print "Hello" :  Next F
  101.  
  102. ^6The use of the colon changes once in Amal.  (More on this later)
  103.  
  104. ^6 To  keep  things simple, to separate commands in Amal, just use a
  105. ^6semi-colon (;) like I have done in the above examples
  106.  
  107. ^6 To  get  commands  into Amal you first need to get them into an Amos
  108. ^6String, the simplest way I have found is to say somthing like :-
  109.  
  110. ^2AM$="For R0=1 To 100 ; Pause ; Next R0"
  111.  
  112. ^6And then to run it use the following:
  113.  
  114. ^2Amal 1,Am$ 
  115. ^2Amal On
  116.  
  117. ^6 This  will  get your Amal program running, (Hopefully!).  If you run
  118. ^6that last program, what do you see?  If you ran it and got absolutely
  119. ^6nothing  at all, then it probably worked OK.  If you got one of those
  120. ^6ever so helpful "Syntex Error in Animation String" messages then look
  121. ^6carefully  at  the  program and make sure that everything is typed in
  122. ^6correctly.
  123.  
  124. ^6 OK.   so  you want me to tell you why you should have got nothing on
  125. ^6the  screen?   Well  if  you look at the above AM$, you may recognise
  126. ^6that it looks a little like an Amos Basic Program i.e.
  127.  
  128. ^2For R0=1 To 200
  129. ^2Pause
  130. ^2Next R0
  131.  
  132. ^6 The Pause statement in Amal is rather like the Wait Vbl statement in
  133. ^6Amos  Basic  ie does nothing but waits for a while (about the same as
  134. ^61/50th  of  a  second).   This  is why nothing appears on the screen,
  135. ^6because  like  all  computer languages, they only do what is asked of
  136. ^6them  no more and no less.  (That's the theory anyway, I've never yet
  137. ^6ASKED  foe a Guru meditation message in any of my programs, they just
  138. ^6happen  whenever the computer seems to feel like it, but you know how
  139. ^6theories go don't you?)
  140.  
  141. ^7 If  you  want something more interesting to happen then we are going
  142. ^7to  have to tell Amal to move something around for us.  To do this we
  143. ^7need  to  tell a Bob or Sprite to ATTACH itself to your Amal program,
  144. ^7to do that we need a Channel Command ie:
  145.  
  146. ^2Channel (Amal program number) to Bob (Bob number)
  147.  
  148. ^7We will now include that in the above example:
  149.  
  150. ^2Load "Sprites.ABK" REM: LOAD IN A SPRITE BANK HERE
  151. ^2AM$="For R01 To 200 : Let X=R0 : Let Y=R0 : Next R0"
  152. ^2Bob 1,0,0,1
  153. ^2Channel 1 To Bob 1
  154. ^2Amal 1, AM$
  155. ^2Amal On 1
  156. ^2Direct
  157.  
  158. ^7 Type  this  in and run it.  Remember that you will need to load in a
  159. ^7sprite bank!
  160.  
  161. ^7 Hopefully this should move your Bob diagonally on the screen.
  162.  
  163. ^7 How do we get it to move back the other way?
  164.  
  165. ^6 Well  I  will  leave you with that teaser and next issue I will tell
  166. ^6you  the  answer,  so why not have a go yourself?  Don't be afraid to
  167. ^6experiment,  you  cannot  do  any harm to your computer if you get it
  168. ^6wrong!   (It  may  sulk and Guru, but just show it who's boss and hit
  169. ^6that left mouse button and try again!)
  170.  
  171. ^2 Finally,  is  there  anything  you want to know how to do in AMOS or
  172. ^2AMAL?   If  so  why  not  drop  a  line  to Totally Amos at the usual
  173. ^2address?
  174.  
  175. ^3                         See you next Issue.
  176.  
  177. ^3                           Paul Townsend.
  178.  
  179. ^4*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF*TF
  180. \