|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Oct 21, 2006 1:33 am
[1.10] Bug / Feature Request ??? |
Not sure how to classify this. There is currently no way to assign a %match result to a LOCAL variable directly. Consider...
#VAR Temp 0 _nodef Money
#LOCAL $Temp
#NOOP %match( %-1, "(%d) Royal Sunburst*", Temp)
#NOOP %match( $MoneyStr, "(%d) Royal Sunburst*", $Temp)
@Temp will have a value and $Temp won't.
Given the advantages of using local variables it would be nice to be able to do so. Granted it may have to be some I'll live with out, or at least until after public release.
This probably applies to all similar functions as well.
P.S. I hope I'm not confusing this with the %mss mentioned elsewhere, but I don't think so. |
|
_________________ Asati di tempari! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Oct 21, 2006 2:04 am |
Actually, both %match and %regex were modified a couple versions ago to support local variables. The problem is with the #NOOP call. The way #NOOP works is that the arguments are expanded, but they are not really compiled.
You need to either assign the %match to a variable to force it to get compiled properly, or in v1.11 you should use the #CALL command instead of #NOOP.
You should never be using #NOOP in CMUD to perform any actions. If you want to execute a function and throw away the result, you must use #CALL instead (which is broken in 1.10).
Here is the alias that works in v1.11:
Code: |
$MoneyStr = "100 Royal Sunburst"
$Temp = 0
#CALL %match( $MoneyStr, "(%d) Royal Sunburst*", $Temp)
#SHOW $Temp |
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Oct 21, 2006 9:09 am |
That's great Zugg I'll give it a short now.
|
|
_________________ Asati di tempari! |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|