LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

quel est lutilité de "&" devant les variables dans une commande?

exp setctrlattribu..............(............................, &OffOn)

0 Kudos
Message 1 of 4
(3,023 Views)

CVI uses C as programming language, so you will need to get some basic comprehension of its concepts, of pointers and operators... You might want to start here

0 Kudos
Message 2 of 4
(3,015 Views)

The '&' operator is used to specify that you are passing the address of a variable, so that called function can operate on it. It is used to pass a variable into which the function can store a value for the caller. It is a basic concept in C language: if you are unfamiliar with it you should spend some time learning this language, as CVI is pure ANSI C language with some additional controls and libraries.

 

I suppose there is a typo in your message: SetCtrlAttribute () is used to Set the attribute of a control on the user interface; in this extent it usually does not require the value to be passed as a pointer but as a value instead. On the other hand, GetCtrlAttribute () is used to retrieve the value of an attribute: this is the typical function thet requires the address of a variable where to store the retrieved value, hence the use of '&'.

 

 

Sorry for answering in English: I don't know French! On the other hand, consider that this is an international board where normally English is the standard language. NI offers a specific board for french-speaking users that you may want to post to if you don't want to write in English.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 4
(3,014 Views)

thanks for all response,

It's vey clear now.

0 Kudos
Message 4 of 4
(2,944 Views)