Hello everyone, this is my first post.
I am teaching myself HScript and I am writing a script using TCL and HScript. I have two questions:
1) When using TCL outside of Houdini, I am able to run the follwing line of code with no problems:
string first $token $stringToParse $index
When I do this within Houdini, I get the following error:
>>wrong # args: should be “string first string1 string2”
Does anyone know why this is or how I can get around it?
2) The second question that when I pass a string from TCL to HScript, I get curly brackets around the string. How can I avoid this?
When I run:
set lightName “keyLight”
set temp “c (0 1 0)”
hscript opparm $lightName -v $temp
I get the error:
>>Skipping unrecognized parameter “{c”
>>Skipping unrecognized parameter “(”
>>Skipping unrecognized parameter “0”
>>Skipping unrecognized parameter “1”
>>Skipping unrecognized parameter “1”
>>Skipping unrecognized parameter “)”
I've figure out that it's because in hscript, $temp becomes { c (0 1 0)}. I tried doing some string manipulations to remove the brackets. It works in hscript, but if I do those same string manipulations from TCl, it does not work.
Any help would be appreciated. Thank you.
TCL within and without Houdini
6209 10 1- idojomo
- Member
- 12 posts
- Joined: July 2005
- Offline
- idojomo
- Member
- 12 posts
- Joined: July 2005
- Offline
Okay I solved problem number 2 by simply rewriting the statement as:
hscript opparm $lightName -v “ $temp ”
instead of hscript opparm $lightName -v $temp
I also tried hscript opparm $lightName -v “$temp” but that does not work either.
I still need help with problem #1 if anyone knows how to solve it.
Thanks
hscript opparm $lightName -v “ $temp ”
instead of hscript opparm $lightName -v $temp
I also tried hscript opparm $lightName -v “$temp” but that does not work either.
I still need help with problem #1 if anyone knows how to solve it.
Thanks
- edward
- Member
- 7734 posts
- Joined: July 2005
- Online
- pbowmar
- Member
- 7025 posts
- Joined: July 2005
- Offline
I used to like TCL, but the curly braces make it a nightmare with Houdini, you get them all the time and have to jump through all sorts of hoops to get rid of them.
I'm growing to like Perl, despite it's often bizarre syntax, because it allows you to define characters to use as quote delimiters, and it has really good Regex support.
You can tie Perl into Houdini using the “openport” Textport command combined with the “hcommand” command-line tools.
Cheers,
Peter B
I'm growing to like Perl, despite it's often bizarre syntax, because it allows you to define characters to use as quote delimiters, and it has really good Regex support.
You can tie Perl into Houdini using the “openport” Textport command combined with the “hcommand” command-line tools.
Cheers,
Peter B
- edward
- Member
- 7734 posts
- Joined: July 2005
- Online
- JColdrick
- Member
- 4140 posts
- Joined: July 2005
- Offline
- idojomo
- Member
- 12 posts
- Joined: July 2005
- Offline
edward, I am not trying to run a procedure. I had a string that I was trying to parse based on a token. So, if I create myString, then try to do something like , I get the error.
Basically, Houdini is telling me the syntax is wrong - it doesn't like the $index part - but that is the correct syntax according to tcl.tk and every other place I have checked.
Basically, Houdini is telling me the syntax is wrong - it doesn't like the $index part - but that is the correct syntax according to tcl.tk and every other place I have checked.
- edward
- Member
- 7734 posts
- Joined: July 2005
- Online
“string” is just a built-in tcl procedure. I've confirmed that it is a tcl/tk version number difference. Compare the documentation for string first in tcl/tk 8.0:
http://www.tcl.tk/man/tcl8.0/TclCmd/string.htm#M6 [tcl.tk]
with the same thing in 8.2.3:
http://www.tcl.tk/man/tcl8.2.3/TclCmd/string.htm#M8 [tcl.tk]
Basically, at some point after tcl/tk 8.0, they added that option start index argument.
http://www.tcl.tk/man/tcl8.0/TclCmd/string.htm#M6 [tcl.tk]
with the same thing in 8.2.3:
http://www.tcl.tk/man/tcl8.2.3/TclCmd/string.htm#M8 [tcl.tk]
Basically, at some point after tcl/tk 8.0, they added that option start index argument.
- idojomo
- Member
- 12 posts
- Joined: July 2005
- Offline
- edward
- Member
- 7734 posts
- Joined: July 2005
- Online
- idojomo
- Member
- 12 posts
- Joined: July 2005
- Offline
-
- Quick Links