Hi, Porter. You wrote:
> http_object: make object! [
Need a better name. How about Http_Scheme?
> ; Attributes.
> protocol: 'http
Ok, so far, but:
> username:
> password:
> hostaddr:
> filepath:
> pagedata:
is a problem. These words are all set to 'get_vals. I'm sure you didn't
mean that. What you really need is storage for each and idea of their usual
type.
> ; Member Functions.
> get_vals: func [] [
> make block! [
> protocol
> username
> password
> hostaddr
> filepath
> ]
> ]
'get_vals doesn't do what you intend. Here's something just a little bit
better:
[
REBOL []
Scheme!: make object! [
scheme: word!
user: string!
pass: string!
host: [tuple! url!]
path: file!
Block: function [Full_FileName][Block][
path: Full_FileName
Block: make block! 10
append block to set-word! 'scheme
append block to lit-word! scheme
append block to set-word! 'user
append block user
append block to set-word! 'pass
append block pass
append block to set-word! 'host
append block to string! host
append block to set-word! 'path
append block to string! path
Block
]
]
Scheme: Scheme!
Scheme/scheme: 'http
Scheme/user: "webuser"
Scheme/pass: "letmein"
Scheme/host: 127.0.0.1
Scheme/path: %mysite/default.htm
Scheme/Block "mysite/default.htm"
]
>> do %scheme.r
Script: "Untitled" (none)
== [scheme: 'http user: "webuser" pass: "letmein" host: "127.0.0.1" path:
"mysite/default.htm"]
I'm sure you'll be able to do the rest. :-)
I hope that helps!
Andrew Martin
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-