<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Brian</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks for your detailed reply.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I wondered if I should have included the code used 
to test the value.&nbsp; Here is one such function</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; BOOL GetIsUTF8Text() { return 
((m_nFieldFlags &amp; TAG_FIELD_FLAG_DATA_TYPE_MASK) == 
TAG_FIELD_FLAG_DATA_TYPE_TEXT_UTF8) ? TRUE : FALSE; }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I see&nbsp;that it is&nbsp;ANDing the Mask.&nbsp; 
There are no other flags using the same byte of this 4 byte flag.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Does this affect the value that will be 
found/stored in this flag for a Binary type?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Ross.</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV><FONT face=Arial size=2>It's a two-bit field by the look of it, using 
  bits 1 and 2 of the word (numbering from bit 0 = least significant to&nbsp;31 
  = most significant).</FONT></DIV>
  <DIV><FONT face=Arial size=2>6 (bit pattern 110) is the mask, ie it's used 
  with a bitwise AND to select just those two bits from the word.</FONT></DIV>
  <DIV><FONT face=Arial size=2>the four values of the two-bit field are 
  apparently:</FONT></DIV>
  <DIV><FONT face=Arial size=2>0 = Text UTF8</FONT></DIV>
  <DIV><FONT face=Arial size=2>1 = binary</FONT></DIV>
  <DIV><FONT face=Arial size=2>2 = External Info</FONT></DIV>
  <DIV><FONT face=Arial size=2>3&nbsp; - reserved</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>So not just a simple 1-bit flag like I thought 
  from what you posted in the first message.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>With the various values of that field the whole 
  word might look like:</FONT></DIV>
  <DIV>
  <DIV><FONT face=Arial size=2>0000&nbsp;0000&nbsp;= Text UTF8</FONT></DIV>
  <DIV><FONT face=Arial size=2>0000&nbsp;0002&nbsp;= binary</FONT></DIV>
  <DIV><FONT face=Arial size=2>0000&nbsp;0004&nbsp;= External Info</FONT></DIV>
  <DIV><FONT face=Arial size=2>0000&nbsp;0006&nbsp; - reserved</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Except, we don't know what might be in the rest 
  of the word. Probably not zeroes, so the values you are interested in will be 
  combined with other fields. Possibly even, that 3-bit field is repeated 
  several times in the word, with additional masking and shifting being used to 
  pick fields out. In your first message, you also showed:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV>
  <DIV><FONT face=Arial size=2>#define 
  APE_TAG_FLAG_CONTAINS_FOOTER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  (1 &lt;&lt; 30)</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>which suggests bit 30 is also used as a one-bit 
  flag. But whether this is in the same word or not can't necessarily be 
  determined from the #defines. You'll probably need to find the code that 
  masks, sets and tests these fields to be sure how they're used, for example 
  look for something like:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; value = (word &amp; 
  TAG_FIELD_FLAG_DATA_TYPE_MASK) &gt;&gt; 1;</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>to extract the value of the field from the 
  word;</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>or, to set the value to, say "External 
  Info":</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; word &amp;= 
  ~TAG_FIELD_FLAG_DATA_TYPE_MASK;</FONT></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; word |= 
  TAG_FIELD_FLAG_DATA_TYPE_EXTERNAL_INFO;</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>To achieve the same operations in Delphi, use the 
  bitwise logical operators not, and, or, xor, shl and shr. Snipped from the 
  help screen:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>
  <DIV>
  <HR>
  </DIV>The following logical operators perform bitwise manipulation on integer 
  operands. For example, if the value stored in X (in binary) is 001101 and the 
  value stored in Y is 100001, the statement</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Z := X or Y;</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>assigns the value 101101 to Z.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>
  <TABLE>
    <TBODY>
    <TR>
      <TH>Operator 
      <TH>Operation 
      <TH>Operand types 
      <TH>Result type 
      <TH>Examples 
    <TR>
      <TD>not 
      <TD>bitwise negation 
      <TD>integer 
      <TD>integer 
      <TD>not X 
    <TR>
      <TD>and 
      <TD>bitwise and 
      <TD>integer 
      <TD>integer 
      <TD>X and Y 
    <TR>
      <TD>or 
      <TD>bitwise or 
      <TD>integer 
      <TD>integer 
      <TD>X or Y 
    <TR>
      <TD>xor 
      <TD>bitwise xor 
      <TD>integer 
      <TD>integer 
      <TD>X xor Y 
    <TR>
      <TD>shl 
      <TD>bitwise shift left 
      <TD>integer 
      <TD>integer 
      <TD>X shl 2 
    <TR>
      <TD>shr 
      <TD>bitwise shift right 
      <TD>integer 
      <TD>integer 
      <TD>Y shl I</TD></TR></TBODY></TABLE><BR>The following rules apply to bitwise 
  operators.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>The result of a not operation is of the same type 
  as the operand.<BR>&nbsp;If the operands of an and, or, or xor operation are 
  both integers, the result is of the predefined integer type with the smallest 
  range that includes all possible values of both types.<BR>&nbsp;The operations 
  x shl y and x shr y shift the value of x to the left or right by y bits, which 
  is equivalent to multiplying or dividing x by 2^y; the result is of the same 
  type as x<BR>. For example, if N stores the value 01101 (decimal 13), then N 
  shl 1 returns 11010 (decimal 26).</FONT></DIV>
  <DIV>
  <HR>
  </DIV></DIV></DIV>
  <P>&nbsp;</P>
  <P>Hope some of this helps clarify things a bit and doesn't just muddy it 
  further,</P>
  <P>Brian</P>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Delphi mailing 
  list<BR>Delphi@ns3.123.co.nz<BR>http://ns3.123.co.nz/mailman/listinfo/delphi<BR></BLOCKQUOTE></BODY></HTML>