send command and comma in parameter
Posted: Tue Dec 06, 2011 10:22 am
Dear colleagues,
I am new in the LiveCode universe, please forgive me, but found a problem I don't know how to handle.
I wrote a simple command "LoadFromFile" which accepts a valid file name in an image control.
When I like to use it inside a Button onMouseup handler and have to call it outside of the normal message path, I learned to use the send command.
But curiously the send command accepts a string. Therefore we have to write:
send "LoadFromFile " & tFileName to image "foo"
But sometimes filenames contains commas and maybe other funny characters, e.g. "my,best,image.jpg" is a valid filename!
Now as my LoadFromFile command accepts only one parameter, it sees only the front part of the file name (in the previous sampe "my").
How do I prevent this?
Do I really have to send custom command names and their parameters as strings???
Do I have to escape special characters in strings which have a special meaning in the LiveCode language?
Thank you in advance,
Thomas
I am new in the LiveCode universe, please forgive me, but found a problem I don't know how to handle.
I wrote a simple command "LoadFromFile" which accepts a valid file name in an image control.
When I like to use it inside a Button onMouseup handler and have to call it outside of the normal message path, I learned to use the send command.
But curiously the send command accepts a string. Therefore we have to write:
send "LoadFromFile " & tFileName to image "foo"
But sometimes filenames contains commas and maybe other funny characters, e.g. "my,best,image.jpg" is a valid filename!
Now as my LoadFromFile command accepts only one parameter, it sees only the front part of the file name (in the previous sampe "my").
How do I prevent this?
Do I really have to send custom command names and their parameters as strings???
Do I have to escape special characters in strings which have a special meaning in the LiveCode language?
Thank you in advance,
Thomas