function.bmx 378 B

123456789101112131415161718192021
  1. Rem
  2. Function marks the beginning of a BlitzMax function declaration.
  3. When a function does not return a value the use of brackets when
  4. calling the function is optional.
  5. End Rem
  6. Function NextArg(a$)
  7. Local p
  8. p=instr(a$,",")
  9. if p
  10. NextArg a$[p..]
  11. print a$[..p-1]
  12. else
  13. print a$
  14. endif
  15. End Function
  16. NextArg("one,two,three,four")
  17. NextArg "22,25,20" 'look ma, no brackets