I created a watch that upon violation produces an event that looks like this:

 "0.0.0.0.0.0.0.4E"

I wrote a little perl script that does what I need (keep in mind, I am not a 
perl expert):

[spectrum@anddevspect04 SwScript]$ cat isoAndConv1.pl
#!/usr/bin/perl
#use strict;
use warnings;
my $input = "0.0.0.0.0.0.0.4E";
$input =~ s/\"//g;
print "Original octet string is $input \n";
$input =~ s/0.//g;
print "Isolated value at the end of the string is $input \n";
$output = $input;
my $output = hex($input);
print "The decimal equivalent of the isolated value is $output \n";

When I run the script, I get the following:

[spectrum@devspect SwScript]$ ./isoAndConv1.pl
Original octet string is 0.0.0.0.0.0.0.4E
Isolated value at the end of the string is 4E
The decimal equivalent of the isolated value is 78
[spectrum@devspect SwScript]$

It removes the double quotes, isolates the last part of the string, and the 
converts that hex value to decimal.  

I now need to do the same thing in Spectrum using event procedures.  This is 
what I have come up with this so far:

 0xfff00049 E 50 P "\
CreateEventWithAttributes( { C CURRENT_MODEL }, { H 0xfff0004b }" \
SetEventAttribute( \
GetEventAttributeList(), \
{ S 7 }, \
GetRegexp( \
GetEventAttribute( { S 7 } ), {S\"s/(0.)+//g\"}, \
{ S 7 })))"

I've verified the code and it looks fine, but I'm getting the following :

Procedure did not parse successfully (error reason: Procedure parsing failure) 
for event 0xfff00049 on line 60 of event disposition file 
../custom/Events/EventDisp
    0xfff00049 E 50 P "CreateEventWithAttributes(     { C CURRENT_MODEL },     
{ H 0xfff0004b } SetEventAttribute( GetEventAttributeList(), { S 7 }, 
GetRegexp( GetEventAttribute( { S 7 } ),  {S\"s/(0.)+//g\"}, { S 7 })))"


I'm not sure where the parsing error is.  I'm thinking that my regex statement 
is wrong.  I need a regex statement that removes the zeros and dots leaving the 
last value, removes the quotes, and then converts the last value to a decimal 
number.  Any help is appreciated.  Thanks.


---
To unsubscribe from spectrum, send email to [email protected] with the body: 
unsubscribe spectrum [email protected]

Reply via email to