On 5/27/11 9:55 PM, Web Admin Himalayan Academy wrote:
nope... that replacement does nothing...

on mouseup
answer file "Choose the Unicode for this song" with "OK"
if the result ="cancel" then exit mouseup
set the useUnicode to true
set the unicodetext of fld "Unicode_Script" to url ("binfile:/" & it)
# result: Tamil appears fine, but all one line

replace numtochar(13) with numToChar(8232) in fld "Unicode_Script"
#does nothing

end mouseup

It was close though. LiveCode uses ascii 10 instead of ascii 13 for line endings. Those are converted automatically when you paste, but not when you put text into a field by script. So just replace cr with unix line endings and it works:

on mouseUp
  set the textfont of fld 1 to "InaiMathi,Unicode"
  answer file "Choose the Unicode for this song" with "OK"
  if the result <>"cancel" then
    get url ("binfile:" & it)
    replace numtochar(13) with numtochar(10) in it
    set the unicodetext of fld 1 to it
  end if
end mouseUp

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to