Characters after URL

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Characters after URL

Post by Andycal » Tue Mar 02, 2010 12:06 pm

I'm trying to launch a URL with the following command:

Code: Select all

launch URL tFilename
tFilename contains a path to the file on a server and in the variable inspector it looks absolutley fine, however when it launches a browser to view the file, it's adding the characters "%0D" to the end of the URL and the browser is giving me a file not found error.

How can I remove those two odd characters??

Andy.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Characters after URL

Post by Janschenkel » Tue Mar 02, 2010 5:07 pm

It means there's a trailing return character in your URL -which gets replaced by the "%0D" you're seeing to make it a 'valid' URL for your browser.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

massung
Posts: 93
Joined: Thu Mar 19, 2009 5:34 pm

Re: Characters after URL

Post by massung » Tue Mar 02, 2010 6:33 pm

It's important to note that %0D (the number 13) is the ASCII character for CR. Simply put: you have a newline at the end of your URL string and need to get rid of it. ;)

Jeff M.

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Re: Characters after URL

Post by Andycal » Tue Mar 02, 2010 6:54 pm

Magic! I will now go and dig through the documentation and work out just how to do that...

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Re: Characters after URL

Post by Andycal » Tue Mar 02, 2010 7:02 pm

OK.

It seems this should be easy. Assuming this character is a carriage return, I did this:

Code: Select all

replace CR with empty in tCurrDoc
But I get the same result. Should I be looking elsewhere for these characters? Is it not as simple as a 'CR'?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Characters after URL

Post by FourthWorld » Tue Mar 02, 2010 7:10 pm

The RevTalk constant "CR" maps to ASCII 10, the linefeed character on Unix which is used for all internal line breaks in the RevTalk engine.

To clear Mac CR's (ASCII 13) from text use:

replace numtochar(13) with empty in tCurrDoc
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply