Levinson, Don A. wrote:
> I am trying to convert a hexadecimal SNMP variable to a string and then
> extract a substring.
> String variables in the HP PML MIB are prepended by 0x0115 so they come
> across as hex, I want to read the string, strip off the first two bytes
> and then print the output.
> 
>       TRAY1_MEDIA_NAME,
> 1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.3.3.1.4,       HEXADECIMAL,    "Media Name"
>       PAPER_NAME,                     (substr($TRAY1_MEDIA_NAME, 2)),
> CALCULATION, "Type of media"

In the function invocation of substr, put the first argument in quotes. Without 
the quotes, the argument is being passed
as a numeric argument.

PAPER_NAME, (substr("$TRAY1_MEDIA_NAME", 2)), CALCULATION, "Type of media"

This is a known problem with the function calling system; there are no typed 
variables, so you have to hint in the
function call via quotes that you want to pass the argument as a string.

Regards,

Bill Fisher
Dartware, LLC
____________________________________________________________________
List archives: 
http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]

Reply via email to