I have some placement code that tries to create a user based on first
character of first name and 4 characters of last name. We evaluate the
last name to see if there is a space in it. If there is we grab 5
characters of the last name and eventually remove all spaces.

My code is correctly noticing that there are no spaces in the last name
field, but it processes all the statements as if there were spaces in
the last name field. Anybody seeing something I'm not?

The first name is BUGS the last name is BUNNY. Here's the code that
sets the local variable to 4 characters of the last name then checks for
spaces in the last name.

<do-set-local-variable name="newuserln" scope="driver">
<arg-string>
<token-substring length="4">
<token-lower-case>
<token-replace-all regex=" " replace-with="">
<token-op-attr name="Surname"/>
</token-replace-all>
</token-lower-case>
</token-substring>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-local-variable mode="regex" name="newuserln" op="equal">.*
.*</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="newuserln" scope="driver">
<arg-string>
<token-substring length="5">
<token-lower-case>
<token-op-attr name="Surname"/>
</token-lower-case>
</token-substring>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="newuserln" scope="driver">
<arg-string>
<token-replace-all regex=" " replace-with="">
<token-local-variable name="newuserln"/>
</token-replace-all>
</arg-string>
</do-set-local-variable>
</arg-actions>
</do-if>

it should have decided there was no spaces in BUNNY and ignored the IF
statements. Here's a trace of that section

13:01:10 C4 Drvrs: HRIFAS PT: Action:
do-set-local-variable("newuserln",scope="driver",token-substring(length="4",token-lower-case(token-replace-all("
","",token-op-attr("Surname"))))).
13:01:10 C4 Drvrs: HRIFAS PT:
arg-string(token-substring(length="4",token-lower-case(token-replace-all("
","",token-op-attr("Surname")))))
13:01:10 C4 Drvrs: HRIFAS PT:
token-substring(length="4",token-lower-case(token-replace-all("
","",token-op-attr("Surname"))))
13:01:10 C4 Drvrs: HRIFAS PT:
token-substring(length="4",token-lower-case(token-replace-all("
","",token-op-attr("Surname"))))
13:01:10 C4 Drvrs: HRIFAS PT: token-lower-case(token-replace-all("
","",token-op-attr("Surname")))
13:01:10 C4 Drvrs: HRIFAS PT: token-lower-case(token-replace-all("
","",token-op-attr("Surname")))
13:01:10 C4 Drvrs: HRIFAS PT: token-replace-all("
","",token-op-attr("Surname"))
13:01:10 C4 Drvrs: HRIFAS PT: token-replace-all("
","",token-op-attr("Surname"))
13:01:10 C4 Drvrs: HRIFAS PT: token-op-attr("Surname")
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "BUNNY".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "BUNNY".
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "BUNNY".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "BUNNY".
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "bunn".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "bunn".
13:01:10 C4 Drvrs: HRIFAS PT: Action: do-if(). Evaluating conditions.
13:01:10 C4 Drvrs: HRIFAS PT: (if-local-variable 'newuserln' match ".*
.*") = FALSE.
13:01:10 C4 Drvrs: HRIFAS PT: Action: do-if().
13:01:10 C4 Drvrs: HRIFAS PT: Evaluating conditions.
13:01:10 C4 Drvrs: HRIFAS PT: Performing if actions.
13:01:10 C4 Drvrs: HRIFAS PT: Action:
do-set-local-variable("newuserln",scope="driver",token-substring(length="5",token-lower-case(token-op-attr("Surname")))).
13:01:10 C4 Drvrs: HRIFAS PT:
arg-string(token-substring(length="5",token-lower-case(token-op-attr("Surname"))))
13:01:10 C4 Drvrs: HRIFAS PT:
token-substring(length="5",token-lower-case(token-op-attr("Surname")))
13:01:10 C4 Drvrs: HRIFAS PT:
token-substring(length="5",token-lower-case(token-op-attr("Surname")))
13:01:10 C4 Drvrs: HRIFAS PT:
token-lower-case(token-op-attr("Surname"))
13:01:10 C4 Drvrs: HRIFAS PT:
token-lower-case(token-op-attr("Surname"))
13:01:10 C4 Drvrs: HRIFAS PT: token-op-attr("Surname")
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "BUNNY".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "BUNNY".
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Action:
do-set-local-variable("newuserln",scope="driver",token-replace-all("'","",token-local-variable("newuserln"))).
13:01:10 C4 Drvrs: HRIFAS PT:
arg-string(token-replace-all("'","",token-local-variable("newuserln")))
13:01:10 C4 Drvrs: HRIFAS PT:
token-replace-all("'","",token-local-variable("newuserln"))
13:01:10 C4 Drvrs: HRIFAS PT:
token-replace-all("'","",token-local-variable("newuserln"))
13:01:10 C4 Drvrs: HRIFAS PT: token-local-variable("newuserln")
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Token Value: "bunny".
13:01:10 C4 Drvrs: HRIFAS PT: Arg Value: "bunny".


--
johnehurst
------------------------------------------------------------------------
johnehurst's Profile: http://forums.novell.com/member.php?userid=1973
View this thread: http://forums.novell.com/showthread.php?t=344201