looking how to suppress a warning from the compiler that says possible data loss,
st:= copy(str,0,2);
where st is string[2] and str has more then 2 chars.
and copy is defied as from str return a new string that is a subset from 0 , 2 places.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you just write:
The compiler will do the work for you.
It will cut
strcontent to fit the maximum length ofst. So ifstis defined asst: string[2];if will retrieve only the 2 first characters ofstr.But you may loose non ascii encoded characters in str (not a problem if it does contain only English text).