|
RAW
Nov 10, 2007 9:21:13 GMT -5
Post by Alyce on Nov 10, 2007 9:21:13 GMT -5
I'm requesting a very simple demo of using RAW. I'm not understanding this as well as I'd like. Can somebody help me out?
|
|
|
RAW
Nov 10, 2007 10:07:54 GMT -5
Post by Alyce on Nov 10, 2007 10:07:54 GMT -5
Here's what I have. Is this a correct usage?
t$ = "<html><head><title>Raw Demo</title><center><h1>Raw Demo</h1></center></head>" t$ = t$ + "<body><p>Hello, Run BASIC!</p><p>Hit the BACK button.</p></body></html>"
print "Testing Run BASIC" print link #lk, "Click Me",[click] wait
[click] raw t$ wait
|
|
|
RAW
Nov 10, 2007 10:56:51 GMT -5
Post by Janet on Nov 10, 2007 10:56:51 GMT -5
I'd like to know the advantage of using raw over html. Modifying Alyce's short demo, this code
t$ = "<html><head><title>Html Demo</title><center><h1>Raw Demo</h1></center></head>" t$ = t$ + "<body><p>Hello, Run BASIC!</p><p>Hit the BACK button.</p></body></html>"
Cls html t$ print: print Link#l, "Click Me to End",[click]
Wait
[click] Cls html t$ End
shows the link to be clicked to end the program. But, Alyce's original Raw demo
t$ = "<html><head><title>Raw Demo</title><center><h1>Raw Demo</h1></center></head>" t$ = t$ + "<body><p>Hello, Run BASIC!</p><p>Hit the BACK button.</p></body></html>"
Cls raw t$ print: print Link#l, "Click Me to End",[click]
Wait
[click] Cls raw t$ End
doesn't display Link#1. So, when would it be preferable to use raw over html?
|
|
|
RAW
Nov 10, 2007 11:24:37 GMT -5
Post by mikeukmid on Nov 10, 2007 11:24:37 GMT -5
I assumed raw was to to get a web page in MIME type text format, ie no backgrounds or image links etc for old browsers which can only display text - maybe I'm not understanding too.
'returns source code for web page a$ = httpget$("http://www.nuip.net/") print a$ print " " link #cont, "Continue",[cont]
wait
[cont] cls
'returns a web page with MIME type text/plain raw httpget$("http://www.nuip.net/")
end
Mike.
|
|
|
RAW
Nov 10, 2007 11:29:26 GMT -5
Post by Alyce on Nov 10, 2007 11:29:26 GMT -5
Mike, that's a nice example.
It works to print out one's own HTML as well, and when you do that, the page does not include any of Run BASIC's html headers. (Try viewing source, both before and after clicking my link.)
|
|
|
RAW
Nov 10, 2007 12:39:05 GMT -5
Post by Alyce on Nov 10, 2007 12:39:05 GMT -5
Mike, I see you edited your message. Now you see the source of my confusion.
|
|
|
RAW
Nov 10, 2007 14:22:54 GMT -5
Post by Brent on Nov 10, 2007 14:22:54 GMT -5
The RAW command does the equivalent to a CLS and WAIT in one command. Therefore it's not necessary to place a WAIT after it.
In its current form, RAW is meant to show plain text only. The fact that IE interprets this text as HTML is probably a bug in IE.
|
|
|
RAW
Nov 10, 2007 14:27:47 GMT -5
Post by Alyce on Nov 10, 2007 14:27:47 GMT -5
The RAW command does the equivalent to a CLS and WAIT in one command. Therefore it's not necessary to place a WAIT after it. In its current form, RAW is meant to show plain text only. The fact that IE interprets this text as HTML is probably a bug in IE. Thanks, Brent. That helps my understanding. I need to install another browser on my test machine so I can see how things work outside of MSIE.
|
|
|
RAW
Nov 10, 2007 14:46:26 GMT -5
Post by mikeukmid on Nov 10, 2007 14:46:26 GMT -5
Sorry Alyce, I thought modding my reply would make things clearer but obviously not. The RB docs give no clue what Carl intended RAW to do but my testing implied it was for plain text - like the difference in plaintext & richtext emails. The source for the returned raw page has "Content-Type" content="text/html;" so maybe that confuses IE, I dont know and don't have other browsers installed. I prefer IE (ducking quickly, covering my head ;D) Tried changing the header to text/plain but that had no effect. Over to Carl?
Mike.
|
|
|
RAW
Nov 10, 2007 15:18:24 GMT -5
Post by carlgundel on Nov 10, 2007 15:18:24 GMT -5
The intent of RAW is really so you can create web services. Another program (even another RB program) can access the server and get back a pure text answer. This could be readable text, XML, rows of comma separated values, or whatever.
-Carl
|
|
|
RAW
Nov 10, 2007 15:22:00 GMT -5
Post by Alyce on Nov 10, 2007 15:22:00 GMT -5
Thanks, Carl. I'll put your explanation on the wiki.
|
|
|
RAW
Nov 10, 2007 15:31:47 GMT -5
Post by turbov21 on Nov 10, 2007 15:31:47 GMT -5
This could be readable text, XML, rows of comma separated values, or whatever. -Carl Carl, last time I tried to use RAW to generate XML, the feed validator I was using rejected it because the header was for "text/plain", has this changed in Beta 5?
|
|
|
RAW
Nov 10, 2007 15:39:25 GMT -5
Post by carlgundel on Nov 10, 2007 15:39:25 GMT -5
Why shouldn't your validator be willing to accept XML in a plain text form?
I'm willing to fix this, but I'm not sure how. Lemme think.
-Carl
|
|
|
RAW
Nov 10, 2007 16:00:19 GMT -5
Post by turbov21 on Nov 10, 2007 16:00:19 GMT -5
Why shouldn't your validator be willing to accept XML in a plain text form? I'm willing to fix this, but I'm not sure how. Lemme think. -Carl I guess it takes it (so mea culpa on the bad wording), but it recommends that the header be "text/xml", here's the page: brrdd.com/?19 (shortened)
|
|
|
RAW
Nov 10, 2007 16:24:50 GMT -5
Post by carlgundel on Nov 10, 2007 16:24:50 GMT -5
Why shouldn't your validator be willing to accept XML in a plain text form? I'm willing to fix this, but I'm not sure how. Lemme think. -Carl I guess it takes it (so mea culpa on the bad wording), but it recommends that the header be "text/xml", here's the page: Thanks. brrdd.com/?19 (shortened) Thanks. Very interesting. -Carl
|
|