LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

textboxline to slider

Hi all,

I want use a string of a textboxline as value in a slider.

I am trying this way!


char destination_buffer;
int n, a;
char *s;

GetTextBoxLine (main_panel_handle, mainpanel_TEXTBOX, 0, destination_buffer);
s = destination_buffer;
n = Scan (s, "%s>%i", &a);
SetCtrlAttribute (manu_panel_handle, manu_panel_red_slider, ATTR_CTRL_VAL, a);

But it doesn't work.
hope anybody can help?!
0 Kudos
Message 1 of 3
(3,018 Views)

You need to pass a string (array of chars) to GetTextBoxLine. Try using:

int       value;
char   buffer[32];

GetTextBoxLine (main_panel_handle, mainpanel_TEXTBOX, 0, buffer);
Scan (buffer, "%d", &value);    or     value = atoi (buffer);
SetCtrlAttribute (manu_panel_handle, manu_panel_red_slider, ATTR_CTRL_VAL, value);



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 3
(3,014 Views)
hi roberto,

thank you very much.

now it´s working
0 Kudos
Message 3 of 3
(3,012 Views)