home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / bwbasic-2.10.sit / bwbasic-2.10 / bwbtest / callfunc.bas < prev    next >
BASIC Source File  |  1993-11-09  |  1KB  |  35 lines

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