PDA

View Full Version : Variable Manipulation Script



reboot181
April 25th, 2003, 02:59 PM
Can anyone help me with the commands needed to do the following.

“Movie.asf “ is Windows Clipboard.
Copy contents of Clip board to the script.

I want to decide what application to launch based upon the extension “asf”

I cant figure out how to strip away the “Movie” part of the string. I have tried the different sting commands but have unable to get them to work.

I am using Girder version 3.2.9

Thanks

JimHugh
April 25th, 2003, 08:34 PM
Check out the string functions at http://www.lua.org/manual/4.0/manual.html#6.2

Not sure of just what you need but here are some examples that might get you started ...

fname = "movie.asf";
equalsIndex = strfind(fname, ".asf");
movieName = strsub(fname, 1, equalsIndex - 1);
extName = strsub(fname, equalsIndex);

print( equalsIndex .. " " .. movieName .. " " .. extName);

Should print
6 movie .asf