Jump to content

String Expression Problem


stass3d

Recommended Posts

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!

Link to comment
Share on other sites

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
/ ->

Link to comment
Share on other sites

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

/ ->

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...