func_streams_readstream.rst 818 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .. _func_streams_readstream:
  2. ==========
  3. ReadStream
  4. ==========
  5. ReadStream -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. ReadStream:TStream( url:Object )
  10. Open a stream for reading
  11. All streams created by #OpenStream, #ReadStream or #WriteStream should eventually
  12. be closed using #CloseStream.
  13. Parameters
  14. ==========
  15. Return Values
  16. =============
  17. A stream object
  18. Examples
  19. ========
  20. .. code-block:: blitzmax
  21. ' readstream.bmx
  22. ' opens a read stream to the blitzbasic.com website and
  23. ' dumps the homepage to the console using readline and print
  24. in=ReadStream("http::blitzbasic.com")
  25. If Not in RuntimeError "Failed to open a ReadStream to file http::www.blitzbasic.com"
  26. While Not Eof(in)
  27. Print ReadLine(in)
  28. Wend
  29. CloseStream in
  30. See Also
  31. ========