Type URL?

BlitzMax Forums/BlitzMax Beginners Area/Type URL?

ima747(Posted 2010) [#1]
I can't find where the URL type is described. I know it can take paths, and protocols, streams, etc. I would like to implement some of that but I don't know where to look in the documentation or source files to figure out how to use it...


ima747(Posted 2010) [#2]
After digging appart some mods I guess I was miss-reading it. URL is generally just an object that you can use ReadStream() and WriteStream() on. Apparently if you do ReadStream() on a stream there's no problem... so you can do readstream without having to know if it's a file or a stream already...


GfK(Posted 2010) [#3]
There is no "URL Type". A URL by definition just tells you where something is, be it a file, a bit of memory, or whatever.

[edit] You replied to yourself while I was typing. :)


ima747(Posted 2010) [#4]
yea, specifically I didn't thing ReadStream() would work properly with a stream as input (doesn't really make sense why you would feed it a stream as input in intentionally) but because you can you can just pass locations (as strings stored in a raw Object) or existing streams (as TStreams stored in a raw object) to any function that's going to open a stream and it will be fine.

Of note a URL type exists in many other environments/languages (such as Objective C...) so I was getting confused when there was poor documentation that didn't state the type that an input value (labeled URL) was (object) so I was assuming there was a type buried somewhere.


gameproducer(Posted 2010) [#5]
Like said, no type :)

You probably already tested this, but doing this anyway: (perhaps somebody finds it usefl)
Local in:TStream = ReadStream("http::www.google.com")
While Not Eof(in)
   Print ReadLine(in)
Wend