stass3d Posted January 13, 2006 Share Posted January 13, 2006 Hello!!! I trying to make OTL In OTL I`ve a File parameter in which i have a value like this: $HIP/cache/armour.$F.bgeo In File node in OTL I need to set this: $HIP/cache/armour.`trunc($FF)`.bgeo I wrote a function: string createFileName(string in){ string filename = chsraw(in); string res = strreplace(filename, '.$F.', '.`trunc($FF)`.'); return res; } If i testing this function in textport, it returns right result: / -> echo `createFileName("/obj/geo1/s3d_FileBlender1/File_path")` $HIP/cache/armour.`trunc($FF)`.bgeo But a File sop errors with a message: Error: Unable to read file : "$HIP/cache/armour.`trunc($FF)`.bgeo" What is wrong? Thanx! Quote Link to comment Share on other sites More sharing options...
peliosis Posted January 13, 2006 Share Posted January 13, 2006 Are you sure : "$HIP/cache/armour.`trunc($FF)`.bgeo" evaluates to the exact names of existing files? Maybe try including the whole string in backticks, not only "trunc($FF)". Not sure though Quote Link to comment Share on other sites More sharing options...
stass3d Posted January 13, 2006 Author Share Posted January 13, 2006 If I put this string direct in file parameter of File sop, it works perfect Quote Link to comment Share on other sites More sharing options...
edward Posted January 14, 2006 Share Posted January 14, 2006 What if you instead did: return evals(res); Quote Link to comment Share on other sites More sharing options...
stass3d Posted January 14, 2006 Author Share Posted January 14, 2006 string createFileName(string in){ string filename = chsraw(in); string res = strreplace(filename, '.$F.', '.`trunc($FF)`.'); return evals(res); } / -> echo `createFileName("/obj/geo1/s3d_FileBlender1/File_path")` Expression error: Syntax error / -> string createFileName(string in){ string filename = chsraw(in); string res = strreplace(filename, '.$F.', '.`trunc($FF)`.'); return evals($res); } / -> echo `createFileName("/obj/geo1/s3d_FileBlender1/File_path")` Expression error: Undefined variable / -> Quote Link to comment Share on other sites More sharing options...
edward Posted January 14, 2006 Share Posted January 14, 2006 Shouldn't it be evals(res) without the $ sign? Quote Link to comment Share on other sites More sharing options...
stass3d Posted January 14, 2006 Author Share Posted January 14, 2006 I tried both , with $ sign and without: string createFileName(string in){ string filename = chsraw(in); string res = strreplace(filename, '.$F.', '.`trunc($FF)`.'); return evals(res); } / -> echo `createFileName("/obj/geo1/s3d_FileBlender1/File_path")` Expression error: Syntax error / -> Quote Link to comment Share on other sites More sharing options...
edward Posted January 15, 2006 Share Posted January 15, 2006 Oh right, that's because the name of the file path is not valid. string createFileName(string in){ string filename = chsraw(in); string res = strreplace(filename, '.$F.', "." + trunc($FF) + "."); return evals(res); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.