Hi All,
What is the easiest way to check a string for spaces?.
If I have a filename called "The movie.mov" contained in a string say tFilename and I want the movie player to play that file without error?.
Checking a string for spaces
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Checking a string for spaces
I just figured out a solution:-
replace space with "%20" in tFileName
seems to work
replace space with "%20" in tFileName
seems to work

Re: Checking a string for spaces
What is the easiest way to check a string for spaces?
Hm, I am having a hard time to figure out the context of these two statements...replace space with "%20" in tFileName

Re: Checking a string for spaces
Klaus.
Who knows what evil lurks in the hearts of men...
dbailey, good that you found a solution, but do you also see other ways to actually discover or delineate whether (and where) a string might contain spaces? A repeat loop that checks each char, or maybe the "is among" operator, that can drill down to the character level?
Craig Newman
Who knows what evil lurks in the hearts of men...
dbailey, good that you found a solution, but do you also see other ways to actually discover or delineate whether (and where) a string might contain spaces? A repeat loop that checks each char, or maybe the "is among" operator, that can drill down to the character level?
Craig Newman
Re: Checking a string for spaces
FYI: If you're working with a full path to the file, and you're using Windows, you can use the shortFilePath function, which returns an 8.3 formatted file path with no spaces:dbailey wrote:If I have a filename called "The movie.mov" contained in a string say tFilename and I want the movie player to play that file without error?.
Code: Select all
put "C:/Program Files/My App/My App Files/The movie.mov" into tPath
put shortFilePath(tPath) into tShortPath
--> puts the string "C:/PROGRA~1/MYAPP~1/MYAPP~1/THEMOV~1.mov" into tShortPath
Ken Ray
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com
Sons of Thunder Software
Email: kray@sonsothunder.com
Web site: http://www.sonsothunder.com