storing hex in metadata

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf storing hex in metadata

  • Creator
    Topic
  • #49730
    Barbara Ho
    Participant

    Hi,

    I need to store hex into the metadata.  However, for some reason some hex values are not being stored properly.  It works for some but not for others.  For example, below the ODBHOSTID in the userdata is missing the ending brace eventually causing a tcl error.  

    Does anybody know why? Do I need to convert the hex to decimal before storing in the metadata?

    Code:

    tcl>set mh [msgcreate]
    message0
    tcl>set hex x00

    tcl>keylset userdata ODBHOSTID $hex
    tcl>msgmetaset $mh USERDATA $userdata
    tcl>msgdump $mh
    msg: 0x3000003c
       msgType           : DATA
       msgClass          : ENGINE
       msgState          : Unknown: 0 (0)
       msgPriority       : 5120
       msgRecoveryDbState: 1
       msgFlags          : 0x2
       msgMid            : [0.0.0]
       msgSrcMid         : midNULL
       msgSrcMidGroup    : midNULL
       msgOrigSrcThread  :
       msgOrigDestThread :
       msgSrcThread      :
       msgDestThread     :
       msgXlateThread    :
       msgSkipXlate      : 0
       msgSepChars       :
       msgNumRetries     : 0
       msgGroupId        : 0
       msgDriverControl  :
       msgRecordFormat   :
       msgRoutes         :
       msgUserData       : {ODBHOSTID
       msgStaticIsDirty  : 0
       msgVariableIsDirty: 1
       msgTimeStartIb    : 1199813173.003
       msgTimeStartOb    : 1199813173.003
       msgTimeCurQueStart: 0.000
       msgTimeTotalQue   : 0.000
       msgTimeRecovery   : 1199813173.003
       msgEoConfig       : 0x0
       msgData (BO)      : 0x30000120
       message           : ”

Viewing 1 reply thread
  • Author
    Replies
    • #63321
      Jim Kosloskey
      Participant

      Barbara,

      I think hex 00 is a no-no in Tcl.

      It looks like in your post you are using hex 00.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #63322
      David Barr
      Participant

      You probably shouldn’t be putting unprintable characters in the metadata.  If you just want to put hex values in the USERDATA, then why not just use “00” instead of “x00”?  The x sequence is supposed to be used to translate hex numbers into the corresponding ascii character.  After you assign x00 to a variable, the variable will not contain “hex data”, it will contain an ascii character.

Viewing 1 reply thread
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10