Expression editor question
I'm having problems with this expression.
I need to set a series of Alterable Values to the numeric conversion of a series of strings
value( "Hotspot1 WalkTo" )
value( "Hotspot2 WalkTo" )
value( "Hotspot3 WalkTo" )
value( "Hotspot4 WalkTo" )
value( "Hotspot5 WalkTo" )
etc.
but I'm trying to write a single action for many strings, so I need to enter the string's name through an expression which retrieves the first part of the name from an alterable string of the objects:
value( "Alterable String J( "Group.Indicator" )" + "WalkTo" )
but obviously I get a syntax error. I've tried many combinations of quotes and brackets without success.
Re: Expression editor question
You have to leave quotes off anything that's to be interpreted - in your example:
value( Alterable String J( "Group.Indicator" ) + "WalkTo" )
However, I'm still not sure what you're trying to do - the string "Hotspot5 WalkTo" (assuming the contents of Alterable String J is ("Hotspot 5 ") doesn't have a direct numeric conversion in the same way that, say, "6" or "94" do.
Re: Expression editor question
Quote:
Originally Posted by DavidN
You have to leave quotes off anything that's to be interpreted - in your example:
value( Alterable String J( "Group.Indicator" ) + "WalkTo" )
I've tried without quotes too, but I get a syntax error nonetheless.
Quote:
Originally Posted by DavidN
However, I'm still not sure what you're trying to do - the string "Hotspot5 WalkTo" (assuming the contents of Alterable String J is ("Hotspot 5 ")
yes, the contents of alterable string J of the Group.Indicator is a "Hotspot1", "Hotspot2", etc. different for each object, so combined with + " WalkTo" (preceded by a space) they should return the names of specific string objects I've created that contain the numeric values (when retrieved as values, since they're strings) I need.
value( Alterable String J( "Group.Indicator" ) + " WalkTo" )
or
value( [color:#FF0000]"[/color]Alterable String J( "Group.Indicator" )[color:#FF0000]"[/color] + " WalkTo" )
should work, but it doesn't, and it's a problem with quotes, I suspect, not with values, since the combined names refer to existing string objects containing text (numeric coordinates) retrieved as value. :crazy:
Re: Expression editor question
Try:
Str$( Val( Alterable String J( "Group.Indicator" ) ) )+ " WalkTo"
stephen1980
Re: Expression editor question
I don't think you can dynamically reference alterable strings, if that's what you're trying to do.
Re: Expression editor question
You can in the latest HWA build, but only by index. AltStrN$( "Active", > Enter value here <) for strings and AltValN( "Active", > Enter value here <) for values.
Re: Expression editor question
Really? I didn't know the names were even stored at runtime.
Re: Expression editor question
Quote:
Originally Posted by stephen1980
Try:
Str$( Val( Alterable String J( "Group.Indicator" ) ) )+ " WalkTo"
stephen1980
the expression editor says "Please enter a numeric expression"
Re: Expression editor question
Val(Str$( Val( Alterable String J( "Group.Indicator" ) ) )+ " WalkTo")
:grin: lol
Re: Expression editor question
Just tried that one too :(
EDIT:
I tried with "value", not "Val": with Val says it's a valid expression! I'm going to test it.