Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multi line edit edit

Status
Not open for further replies.

kmsam2

Programmer
May 21, 2003
29
MY
have a multi line edit box, if user key in 3 line, I want to save into 3 different records into a table.
Anyway to substring the text from multi line edit


Sam.
 
Here is a function called f_split_string
This function takes in an empty string array , delimiter and the string you want to split

<usage : f_split_string(string asa_output_string_array[], string as_seperateor,string as_string)>

long ll_sep_len, ll_counter, ll_array_size
string ls_temp = '', ls_current_string = ''

ll_array_size = 1

if IsNull (as_seperator) AND IsNull (as_string) then
asa_output_string_array[ll_array_size] = ''
return
elseif IsNull (as_seperator) then
asa_output_string_array[ll_array_size] = as_string
return
end if

ll_sep_len = len (as_seperator)


if ll_sep_len > 0 then
for ll_counter = 1 to len (as_string)

ls_temp = mid (as_string, ll_counter, ll_sep_len)
if ls_temp = as_seperator then

asa_output_string_array[ll_array_size] = ls_current_string

ll_array_size += 1
ls_current_string = ""

ll_counter += ll_sep_len - 1
else
ls_current_string += mid (as_string, ll_counter, 1)
end if
next
asa_output_string_array[ll_array_size] = ls_current_string

else
for ll_counter = 1 to len (as_string)
asa_output_string_array[ll_counter] = mid (as_string, ll_counter, 1)
next
end if

you can call this fn. as follows
string output[]
f_split_string[output,'~r~n',mle_1.text)

cheers
MM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top