How can I use japanese in variables?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

How can I use japanese in variables?

Post by Mag » Thu May 30, 2013 2:46 pm

Hi all,

I have all the languages localization texts (including Japanese) in fields, one for each language. All appairs OK.

When I get a chunk of the text from a field and put it into another field all appears OK:

Code: Select all

 
   set the unicodeText of the field test to the unicodeText of item 2 of line 4 of field japanese

Obviously, when you try to do this with a variable, this don't work:

Code: Select all

   set the unicodeText of myVariable to the unicodeText of item 2 of line 4 of field japanese  ##Don't work, pseudo code
   set the unicodeText of the field test to unicodeText of myVariable
How do you suggest to proceed to put that chunk in a variable before to use it in other fields?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How can I use japanese in variables?

Post by Mark » Thu May 30, 2013 2:59 pm

Hi,

This should be:

Code: Select all

   put the unicodeText of item 2 of line 4 of field "japanese" into myUnicodeVar
   set the unicodeText of the field "test" to myUnicodeVar
Note that myUnicodeVar contains binary data, not text. Also note the use of quotes.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: How can I use japanese in variables?

Post by Mag » Thu May 30, 2013 3:22 pm

Thank you Mark (I'm just reading your book these days), works great.

Do you know if there is a way to use it also in ask and answer dialogs?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How can I use japanese in variables?

Post by Mark » Thu May 30, 2013 3:34 pm

Hi,

You should be able to use the htmlText for dialogs:

Code: Select all

put the htmlText of fld "test" into myHtmlVar
answer warning myHtmlVar
Page 41 of the book :-)

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: How can I use japanese in variables?

Post by Mag » Thu May 30, 2013 4:24 pm

Thank you, works great!

PS
Found also in the book :)

Post Reply