|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu Sep 23, 2010 9:07 am
[3.xx] %subregex does not accept dbrec.key syntax |
As you may or may not know, Aardwolf color codes consist of the character @ followed by a letter indicating the color to be use. For instance @M means "bright magenta" and @R means "bright red".
With this in mind, I ran the following test:
Code: |
$pattern = (%char( 64) + "(?<n>\w)")
;;
$string = (%char( 64) + "MThis is " + %char(64) + "Ra test")
;;
#ECHO %subregex( $string, $pattern, "<color @colordb.%ascii(\n)>") "</color>"
|
To see if I could have a simple and quick routine to decode the mud color codes.
What the #ECHO returns in the above code is the entire database record prefixed to the output string: <dbrec>.is a test.
However if I use the classic key/value format:
Code: |
$pattern = (%char( 64) + "(?<n>\w)")
;;
$string = (%char( 64) + "MThis is " + %char(64) + "Ra test")
;;
#ECHO %subregex( $string, $pattern, "<color %db( @colordb, %ascii(\n))>") "</color>"
|
the operation works, emitting the correct colors.
Note that $var = @colordb.%ascii("M") works.
Here is the database record:
Code: |
<var name="colordb" type="Record" id="927">
<value>82=red|114=darkred|71=green|103=darkgreen|66=blue|98=darkblue|67=cyan|99=darkcyan|77=magenta|109=darkmagenta|89=yellow|121=darkyellow|87=white|119=darkwhite|68=grey</value>
<json>{"121":"darkyellow","119":"darkwhite","114":"darkred","109":"darkmagenta","103":"darkgreen","99":"darkcyan","98":"darkblue","89":"yellow","87":"white","82":"red","77":"magenta","71":"green","68":"grey","67":"cyan","66":"blue"}</json>
</var>
|
|
|
_________________ Sic itur ad astra. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Sep 23, 2010 4:37 pm |
This is already reported in another thread. Database records within Regular Expression patterns are broken in v3.29. Should be another update later today.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Sep 23, 2010 4:40 pm |
Actually, nevermind, this is a different issue. But this is not going to be fixed. CMUD does not support the syntax:
@dbrec.%function...
The fact that $var = @colordb.%ascii("M") works is just a side effect that you got lucky with. You MUST use the %db function to do something like this. |
|
|
|
|
|
|
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
|
|