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
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?
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.
Last Edit: Nov 10, 2007 11:44:46 GMT -5 by mikeukmid
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.)
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?
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.
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?
Post by carlgundel on Nov 10, 2007 15:39:25 GMT -5
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?
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
Last Edit: Nov 10, 2007 15:40:28 GMT -5 by carlgundel