STUSK (Stupid site keeper)

Share your advanced PureBasic knowledge/code with the community.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Since I use an embedded web template in a web gadget, using the SetGadgetText directive on the written out template which then loads the modified template from disk, the string sin the gadget have to obey the web gadget formatting rules (Whatever they are).

I've worked out that a 655pixel width is just about approximate to an A4 paper size and designed the web template to wrap the text in a field.

Most data wrap fine, but one doesn't

I've had 166 records with some strings over 2 pages long, 20 fields with no spaces, they all wrap. Some fields wrap at the question mark (?), some wrap at the dash char (-), some at the space ( ) which makes sense. So, I need to find out what characters cause the html to force wrapping.

The below line won't wrap at all and forces the record that it is in to look bad.

"http://corporate.digitalriver.com/store ... mbElement5"

More research to do.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

If I can remember correctly, ages ago I had a similar problem, I think I solved it by inserting <wbr> tags after any /'s in offending lines.

Not sure If this is correct, or if it still works.
I can't find the old code I used (may have been in an old vb project)
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Perkin wrote:If I can remember correctly, ages ago I had a similar problem, I think I solved it by inserting <wbr> tags after any /'s in offending lines.

Not sure If this is correct, or if it still works.
I can't find the old code I used (may have been in an old vb project)
Well I'll be smegged on, it works!! You should be writing parts of this software, not me:):):) I know bugger all about html apart from the very basics. I knew it had to be some sort of translation thingy.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

Glad to help :D
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Perkin wrote:Glad to help :D
Can you think of any other characters that need this treatment? If not, I'll post the updated exe online.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

I think if you used the tag after any character which it made sense that the line should continue on (but as you say wouldn't wrap otherwise).
Here's a few ( all usually part of an address )
/ . ? & =

You might instead add the tag after every n'th character, where field width should wrap, but then you have to know text width's, unless you use a fixed width font for addresses and wrap at exact chars.
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Perkin wrote:I think if you used the tag after any character which it made sense that the line should continue on (but as you say wouldn't wrap otherwise).
Here's a few ( all usually part of an address )
/ . ? & =

You might instead add the tag after every n'th character, where field width should wrap, but then you have to know text width's, unless you use a fixed width font for addresses and wrap at exact chars.
I'm not using any particular font, the web gadget just loads whatever is the default on that user's system for the II browser and I could be wrong but I think the web gadget uses that?

Never mind, I will add those chars, this is looking better.

I was thinking of buying srod's printing/report tool but it would be overkill for this small freeware program. Still would have been more precise than a web gadget but this does work.

I'll add those extra chars tomorrow. Will be out most of the day.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

I won't be checking the forums for a long while as my father is nearly gone (got a day at the most) and I will be busy taking care of things and finalising the estate.

Those who need me for my junk support know how to get a hold of me.

Adieu.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
yrreti
Enthusiast
Enthusiast
Posts: 546
Joined: Tue Oct 31, 2006 4:34 am

Re: STUSK (Stupid site keeper)

Post by yrreti »

My condolences Fangbeast

Sorry for your loss.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

It took a lot longer, long illness, longer than anyone expected. But he finally passed away quietly at 8:05am this morning, at peace at last. I'll be busy for a while.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: STUSK (Stupid site keeper)

Post by srod »

My condolences fangles. Very sorry to hear this news.
I may look like a mule, but I'm not a complete ass.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

srod wrote:My condolences fangles. Very sorry to hear this news.
Thank you. Everyone is crying, walking around like zombies but I have made all the funeral arrangements for Monday, signed all documents, finalised everything and Apu (dad in English) is finally out of pain and in peace.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Post Reply