LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Command on change GetCtrlVal.

1. To get value of panel element we need use function GetCrtlVal (PH, P_ELEMENT, &val).

 

Return value - int only, indicator of error.

 

What command-analog you know? I want to do that:

 

val=analog_getctrl_val(...)

(call) func(val).

 

or (call) func(analog_getctrl_val(...)).

 

 

2. Other little questions:

- if i have path "C:\111\222\333\444" - i know, how get the left part "/" ("C:\). How with one function get right path ("444")?

 

- how add to string integer? Have a string "Added", integer "1000" and string "files". How implode that in 1 string? Can i do this implosion in function arguments?

(call) func(string "string + int + string")?

 

- in VB command "xxx mod 100" - means "if xxx divide to 100". How write that in CVI?

0 Kudos
Message 1 of 2
(3,319 Views)

A1. GetCtrlVal returns the value read in the third parameter, the one you pass by reference, There is no other way to use that command. The correct usage is:

    GetCtrlVal (panelHandle, PANEL_CONTROLID, &val);

    func (val);

Your alternatives cannot be implemented with native commands.

 

A2.

1. I suggest you to study SplitPath () command.

2. You cannot build a string like in VB: use sprintf instead.

    sprintf (destinationString, "%s %d %s", "Added", 1000, "files");

    func (destinationString);

3. In VB mod returns the remainder of a division. To implement this in CVI you can use either fmod () command (for doubles) or the remainder opeator "%" (for integers)



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 2 of 2
(3,292 Views)