Re: Two questions about the following lines of code



On Aug 22, 8:39 pm, Chad <cdal...@xxxxxxxxx> wrote:
On Aug 22, 6:12 pm, pete <pfil...@xxxxxxxxxxxxxx> wrote:
You can read the tag to see what type of data is in the union.

Okay, I really don't see how it reads the tag to see what type of data
is in the union. I'm suspecting I'm going to have to break out the
debugger and step through the code to see what you are talking about.

Are you perhaps confused by the enumeration? An enumeration defines
integer constants by the names you provide between the braces (in this
case, DAYS and HOURSMINUTES, corresponding to 0 and 1, respectively,
although more are allowed). The code that "sets" the type of the
structure assigns one of these symbols (DAYS or HOURSMINUTES) to the
"tag" field and only modifies the intended field of the union. The
code that has to determine the value of the structure reads the "tag"
field and sees which enumeration value it contains (again, DAYS or
HOURSMINUTES) and then makes sure to read only the field of the union
that was last written.

.



Relevant Pages

  • Re: Challenge: nested FOR XML EXPLICIT query with data not in target t
    ... AS Tag ... ,NULL AS Parent ... FROM vConsolidationPrinting ... UNION ALL ...
    (microsoft.public.sqlserver.xml)
  • Re: FOR XML EXPLICIT - Empty Tags?
    ... You can do it by adding another tag (and therefore another UNION) to your ... SELECT 1 AS Tag, ... FOR XML EXPLICIT ... I need to output a query in a given XML format and I figure I'd have a stab ...
    (microsoft.public.sqlserver.xml)
  • Re: Nesting dis-similar hierarchies
    ... is a tag that groups teams and games. ... The whole thought behind making this one XML ... > UNION ... > BracketNumber, GameNumber, ...
    (microsoft.public.sqlserver.xml)
  • Re: FOR XML EXPLICIT problem
    ... following destination. ... Thus if you want to include the salesperson_id tag ... > UNION ALL ... > -- get origin info ...
    (microsoft.public.sqlserver.xml)
  • Re: Axiom of Induction???
    ... the union is not countable. ... what determine this 'same time' enumeration? ... A countable set is one which can be put into 1-1 correspondence ...
    (sci.math)