texaspete
New Member
Actually I am an old member. just been working hard for a long time
Posts: 21
|
Post by texaspete on Aug 20, 2020 12:09:46 GMT -5
The following code when written gives me an error. IT has been a long time sense I wrote the code. I am now making some up dates. Q$=chr$(34) A$="<meta charset="+Q$+"UTF-8"+Q$+" >"
print #whtml,A$
When in try to print it to disk, I get and error. Can any body quickly remind me what is wrong.
Texas Pete
Thanks a lot!
|
|
|
Post by Chris Iverson on Aug 20, 2020 13:04:11 GMT -5
I don't think I see anything wrong with just that snippet.
What's the error you get? And are you able to post a small snippet of code that reproduces the error?
|
|
texaspete
New Member
Actually I am an old member. just been working hard for a long time
Posts: 21
|
Post by texaspete on Aug 20, 2020 14:58:52 GMT -5
Chris, I did not see anything wrong with it either. I will see if I can find an error code: I will try to get back to you.
Texas Pete
|
|
|
Post by tenochtitlanuk on Aug 20, 2020 15:41:54 GMT -5
Your supplied code does not open a file or close it afterwards..
Try
nomainwin
open "Example.html" for output as #whtml
Q$=chr$(34) A$="<meta charset="+Q$+"UTF-8"+Q$+" >"
print #whtml,A$
close #whtml
It would be better practice to use the newer syntax- and remember the printing to file appends a CRLF UNLESS you put a semicolon at the end. If assembling html code strings this will help readability of the source file!
#whtml A$;
|
|
|
Post by metro on Aug 20, 2020 18:13:05 GMT -5
change the extension to .txt........magic the first thing I did was double click on the created file and saw nothing because my browser opened it
|
|
texaspete
New Member
Actually I am an old member. just been working hard for a long time
Posts: 21
|
Post by texaspete on Aug 22, 2020 11:29:48 GMT -5
Please, I hope that someone would be kind enough to look at this snippet. It passed syntax checking, but I was informed the lastest up date of lb changed the way The Program would read and write html. Will there be any problem reading this into an editor. This allows it to be printed to a screen. I did check for errors, However two peoples eyes are better than one.
Thanks Philip Hughes aka Texas Pete
Q$=chr$(34)
open PROJECTFILE$ for output as #whtml
A1$="<meta charset="+Q$+"UTF-8"+Q$+">":print A1$
print #whtml,A1$;
print A1$
A2$="<meta name="+Q$+"viewport"+Q$+" content="+Q$+"width=device-width, initial-scale=1"+Q$+"/>"
print A2$
'"viewport"+Q$+ content=+Q$+"width=device-width, initial-scale=1"+Q$+"/>"
print A2$
print #whtml,A2$;
' ================================================
A3$="<meta name="+Q$+"robots"+Q$+" content="+Q$+"index, follow"+Q$+"/>"
A4$="<meta name="+Q$+"bingbot"+Q$+" content="+Q$+"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"+Q$+"/>"
A5$="<meta name="+Q$+"googlebot"+Q$+" content="+Q$+"index,follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"+Q$+"/>"
print #whtml,A3$;
print #whtml,A4$;
print #whtml,A5$;
print A3$
print A4$
print A5$
close #whtml
print "Finished!"
|
|
|
Post by tenochtitlanuk on Aug 22, 2020 13:56:58 GMT -5
I'm not clear what you are trying to do. The following version writes an html page to a file and opens it in a web browser. I know however nothing about the meta tags..
nomainwin
PROJECTFILE$ ="pete.html" Q$ =chr$( 34)
open PROJECTFILE$ for output as #whtml
#whtml "<html>" #whtml "<meta charset=" +Q$ +"UTF-8" +Q$ +">" #whtml "<meta name=" +Q$ +"viewport" +Q$ +" content=" +Q$ +"width=device-width, initial-scale=1" +Q$ +"/>" #whtml "<meta name=" +Q$ +"bingbot" +Q$ +" content=" +Q$ +"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"+Q$+"/>" #whtml "<meta name=" +Q$ +"googlebot" +Q$ +" content=" +Q$ +"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"+Q$+"/>" #whtml "<header>" #whtml "</header>" #whtml "<body bgcolor=" +Q$ +"C0C080" +Q$ +">" #whtml "<center>" #whtml "<h1>" #whtml "Heading" #whtml "</h1>" #whtml "</center>" #whtml "Sample text" #whtml "<p>" #whtml "<hr>" #whtml "</body>" #whtml "</html>"
close #whtml
run "explorer.exe pete.html"
end
|
|
texaspete
New Member
Actually I am an old member. just been working hard for a long time
Posts: 21
|
Post by texaspete on Aug 24, 2020 13:53:08 GMT -5
tenochtitlanuk,
I am upgrading my program to be able to see it properly on most phones. This as I understand it is a requirement for Google. I am modifying some of the metastatements. Please be aware I don't think I need any help with the metastatement. I am trying to make sure they are readable by a browser. I have been having some problems writing the syntax in Lb4.5.1 . The above was a sample test. I was concernted about getting the chr$(34) the right place to make a successful read of the above html file.
Philip Hughes Texas Pete
There appears to be changes between 4.04 and 4.5.1 versions. I am testing my changes.
|
|