ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1.0 KiB

  1. rem ----------------------------------------------------
  2. rem CallFunc.BAS
  3. rem ----------------------------------------------------
  4. Print "CallFunc.BAS -- Test BASIC User-defined Function Statements"
  5. Print "The next printed line should be from the Function."
  6. Print
  7. testvar = 17
  8. x = TestFnc( 5, "Hello", testvar )
  9. Print
  10. Print "This is back at the main program. "
  11. Print "The value of variable <testvar> is now "; testvar
  12. Print "The returned value from the function is "; x
  13. Print "Did it work?"
  14. End
  15. rem ----------------------------------------------------
  16. rem Subroutine TestFnc
  17. rem ----------------------------------------------------
  18. Function TestFnc( xarg, yarg$, tvar )
  19. Print "This is written from the Function."
  20. Print "The value of variable <xarg> is"; xarg
  21. Print "The value of variable <yarg$> is "; yarg$
  22. Print "The value of variable <tvar> is "; tvar
  23. tvar = 99
  24. Print "The value of variable <tvar> is reset to "; tvar
  25. TestFnc = xarg + tvar
  26. Print "The Function should return "; TestFnc
  27. End Function