Hello,
Has anyone ever performed a Split function in SCADA Basic?
Thanks
Stéphan
Comments are useless for a smart boy like you
SUB Str_Extract_Data(Line,Index)
DIM hdl as long;
DIM ch as str;
DIM length as integer;
hdl = ALLOC_BUFFER(1000);
PUT_BUFFER(hdl, 0,Line);
length = ASCIIFIELD("LEN",hdl);
if(length>0 && ASCIIFIELD("COUNT",hdl,";")>1) then
ch = ASCIIFIELD("STR",hdl,Index,";");
else
ch = ASCIIFIELD("STR",hdl,Index,",");
end if
free_buffer(hdl);
return(ch);
END SUB
HI Stephan,
I don't really understand your request.
You want to split a string in an Array according a separator?
If yes, you have 2 instructions in scada basic: ASCIIFIELD and SEQ_BUFFER
The difference between these 2 instructions is the performances and features.
Asciifield is usefull for small string like 1 line.
Seq_buffer is performant if you want to extract line from a file (separator is n). Also it is able to insert string...
Nico
I'm a little lazy and I wanted to know if someone already had something done.
But I got my answer.
Thank you


