Page 1 of 1

Text Artifact

Posted: Tue Oct 06, 2009 5:17 am
by bidgeeman
Hello.

I created a little News ticker stack that connects to the internet and downloads a text (.txt) file to a text field.

Code: Select all

on openStack
   put empty into field "News"
   put URL "http://www.errolgray.com.au/News.txt" into field "News"
   end openStack
I sent the stack to a friend and he said that after each word there appeared a box? He showed me a screenshot and there indeed is a little square box after each word.

Can someone shed light on what's happening and how I might get rid of the little boxes?

Cheers
Bidge

Text Artifact

Posted: Tue Oct 06, 2009 6:34 am
by dickey
G'day Bidge,

Just a thought but perhaps the content from the web is url encoded.

You might try URLDecode before putting the text into your field.

try something like:

Code: Select all

   put empty into field "News" 
   put URL "http://www.errolgray.com.au/News.txt" into varContent
   put URLDecode(varContent) into field "News"
I hope this helps.

Kind regards, Andrew

Posted: Tue Oct 06, 2009 7:14 am
by bidgeeman
Hi dickey.

Many thanks for the help. I'll see if it works on my friends side and let you know.

Cheers
Bidge

Posted: Tue Oct 06, 2009 7:37 am
by bidgeeman
Hi.

:(

For some reason that did'nt work dickey....he is still seeing little boxes at the end of each line of text for some reason.

Bidge

Posted: Tue Oct 06, 2009 8:58 am
by Mark
Hi Bidge,

Can we see the screenshot?
Which operating system does your friend use?
Which operating system do you use?

You might try this:

Code: Select all

on openstack
     put url "http://www.errolgray.com.au/News.txt" into myVar
     if the platform is not "win32" then
          replace crlf with cr in myVar
     end if
     put myVar into fld 1
end openstack
Best,

Mark

Posted: Tue Oct 06, 2009 9:29 am
by bidgeeman
Hello Mark.
Thanks for that. I will try it and see if they are still appearing.

Image
Is this a carriage return error?

I use XP Home 32 bit and I'm sure he has same
as he opened the exe ok.

He is in the US and asleep right now so I will have to wait till tomorrow
to see if it works.

Cheers
Bidge

Posted: Tue Oct 06, 2009 9:37 am
by Mark
Hi Bidge,

I think what is happening is the following.

You create linefeed-delimited text in a field (the Rev carriage return is actualy a linefeed). You save the text in a text file and Revolution converts the line delimiters to crlf.

If you create a text file directly in Notepad on Windows, the line delimiters will be crlf too.

Now your friend reads the URL. Data from a URL is read as binary, not as text. Therefore, Revolution doesn't convert the crlf back to lf. The remaining carriage returns become visible as squares.

This might also depend on the font being used. Some fonts show a square, other fonts a very tiny space, and yet other fonts may show nothing at all.

Best,

Mark

Posted: Tue Oct 06, 2009 10:54 am
by bidgeeman
Hi Mark.

Thanks so much for the explanation and the code. It makes senses that it should do the trick. I'll let you know tomorrow.

Many thanks again for the help.

Cheers
Bdge