摘抄 : max mel 的一些用法。

clearListener()
char="0123456789abcdef"
for i=1 to char.count do
for j=1 to char.count do
(
s=execute("\"\\x"+char[i]+char[j]+"\"")
format "%% %\n" char[i] char[j] s
)

print "\x1f\x1e"

将字符串当做脚本执行的方法

MXS:execute

Mel:eval evalDeferred evalEcho

转换大小写的方法

MXS:toupper tolower

Mel:toupper tolower

匹配字符串的方法

MXS:matchPattern strcmp

Mel:match gmatch strcmp

针对路径以及文件名的方法

MXS:

file="g:/subdir1/subdir2/myImage.jpg"
filenameFromPath file -- 返回: "myImage.jpg"
getFilenamePath file -- 返回: "g:\subdir1\subdir2\"
getFilenameFile file -- 返回: "myImage"
getFilenameType file -- 返回: ".jpg"
pathIsNetworkPath "c:/temp/test.txt" --返回: false
pathIsNetworkPath "//someserver/temp/test.txt" --返回: true

Mel:

basenameEx("C:/aw/godzilla/hello.c");// 返回: hello

原文地址:https://www.cnblogs.com/gaitian00/p/2152317.html