AnsweredAssumed Answered

vrf Measurementcomputing UL example on compiled functions.

Question asked by VRFuser on Aug 12, 2005
> Looked at the h file, and it helped me further.

Excellent! Sounds like you are doing well.

> some of the example they supplied do not work.

That's nothing new Examples are often the last thing that happens,
usually cobbled together from test code but changed here and there for
clarity. And there's always something else that's higher priority so
mistakes can go uncorrected for quite long. I'm sure if you ask their
helpdesk you can get clarification or correction.

> Guess you cant help me here.

The way I usually do that kind of stuff in C is to do an enumeration like

typedef enum vrVoltageRange {

And then the function declaration like so:
int SetVoltageRange(HDEV hDevice, VOLTAGE_RANGE vr);

That way, when you're writing code you see stuff like SetVoltageRange(hDev,
vrZeroToTen); instead of SetVoltageRange(hDev, 2); which is functionally
exactly the same yet conveys less information as you read (this is how we
text programming people keep from going crazy). As a bonus, if you do the
function declaration that way the compiler won't let you pass 2 - you *have*
to use one of the enumeration labels.

So if the argument to the selection function is an int, you're almost
guaranteed that there's probably an enumeration somewhere that specifies
exactly what 0, 1, 2, 3, 4... means.

OTOH, that's just the way I'm used to stuff! I may be way out in left field
there. Unfortunately won't even let you see an .h
file without paying for the library so I'm afraid I really can't help much
as I've never used it.

Maybe somebody has used the Universal Library & can offer help.

You are currently subscribed to vrf as:
To subscribe send a blank email to "".
To unsubscribe send a blank email to "".
To send messages to this mailing list,  email "". 
If you need help with the mailing list send a message to "".