TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: TIM HUTZLER
from: BOB SEWELL
date: 1997-01-29 20:48:00
subject: passing user types to su

 In a deposition submitted under oath, Tim Hutzler said:
    Tim, I saw you received one reply already, but I noticed something
 else I thought might be wrong, in case the first reply didn't fix all
 the problem and you still hadn't figured it out.  Or it may not be a
 problem at all; I am somewhat ignorant as yet about unions.
 TH> I get the following error when I try to compile the following test
 TH> program.
 TH> +------------------------------------------------+
 TH> | Error 481: Parameter mismatch                  |
 TH> +------------------------------------------------+
 TH> DECLARE FUNCTION HexOut(Dbyte) AS STRING
 TH> UNION Dbyte
 TH>   B AS bw 'so I can look at individual bytes
 TH>   Dd AS DWORD 'this is the numeric
 TH> Ds AS STRING * 4 'this will be the string representation
 TH> END UNION
 TH> DIM D4 AS Dbyte
 TH>   HexOut(D4.B.b3); HexOut(D4.B.b4)
 TH> FUNCTION HexOut (h AS Dbyte) AS STRING 'here's the problem
    Your declare prototype statement and actual function description
 have the whole union type specified as being passed, yet the actual
 call in the body of your program only passes part of the specified
 union type, the part that is another union entirely.  Shouldn't you be
 passing what you declare, or do unions (which I admit I have never used
 in PowerBASIC, and haven't studied yet in C++) work differently when
 passed to a function?
... Do radioactive cats have 18 half-lives?
--- PPoint 1.96
---------------
* Origin: Seven Wells On-Line * Nashville, TN (1:116/3000.12)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.