LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetTextBoxLineLength

Hi, I am trying to read a IP address from a text box and validate it, but something is wrong here, any help  

I am getting the length of 0 after reading the IP.

 

int addrLength;

 

 

sprintf(buf,"Please check the SmartBits IP Address\n");
 
  
addrLength =  (GetTextBoxLineLength(panel, PANEL_IP,0,&length)) ;

if (addrLength<4)
  
   {
    
    MessagePopup("QoS Testing1",buf);
    break;
    
  }  
  IpAddr= (   GetCtrlVal (panel, PANEL_IP , ip)); 
  
 
  if (IpAddr <0)

{
    MessagePopup("QoS Testing",buf);
    break;
    
   
  }
  

0 Kudos
Message 1 of 5
(2,750 Views)

Just a question: you are getting the lenght in 'lenght' variable, but you are testing 'addLenght' variale for the correct number of bytes. Is this a typo or may you be using a wrong variable defined elsewhere in your code?



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 5
(2,739 Views)

AddrLength is just a variable that I declare as shown at the start of this piece of code. I taught I could do it this way to get the length.

0 Kudos
Message 3 of 5
(2,722 Views)

What Roberto was pointing at is that the length is returned in your parameter length, while you are comparing the value of addrLength, which actually is the status, not the length...

0 Kudos
Message 4 of 5
(2,714 Views)

Ok, I think I understand.

 

Thanks.

0 Kudos
Message 5 of 5
(2,709 Views)