LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

scan modifiers

I am trying to use the various 'scan' modifiers to give a result similar to the basic 'mid$' function which will extract a specific part of a string e.g.
 
Databuffer = "ABCDEFGHIJ", and I want to extract the section of the string starting from the 3rd point up to the 6th point in the string, giving the result "CDEF".
 
Please can anyone help?
 
Many thanks
 
 
0 Kudos
Message 1 of 3
(2,908 Views)
The simplest way is to use strncpy:
 
strncpy (databuffer[2], targetstring, 4);
targetstring[4] = 0;   // This correctly terminate the string
 


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
(2,903 Views)
Roberto,
 
Many thanks for your help - it works!!
 
Allen
0 Kudos
Message 3 of 3
(2,901 Views)