function cstrlength(str)
temp_str=len(str)
cstrlength=0
for i=1 to temp_str
test_str=(mid(str,i,1))
if asc(test_str)>0 then
cstrlength=cstrlength+1
else
cstrlength=cstrlength+2
end if
next
end function
function cstrleft(str,l)
temp_str=len(str)
for i=1 to temp_str
test_str=(mid(str,i,1))
cstrleft=cstrleft&test_str
if asc(test_str)>0 then
lens=lens+1
else
lens=lens+2
end if
if lens>=l then exit for
next
end function