The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Special characters in a text string
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JonasKlim

Lithuania
36 Posts

Posted - 12/04/2017 :  10:03:08 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,
I want to write a script to enter text strings with special characters, like → (arrow - Nr 2192 from character map.
How to program these symbols in strings?

Best regards,

Jonas

Chris D

428 Posts

Posted - 12/04/2017 :  1:58:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you explain a little more exactly what you'd like to do?

Also what version of Origin are you using?



Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

JonasKlim

Lithuania
36 Posts

Posted - 12/05/2017 :  03:05:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Chris,

I am using Origin Student 2018, 64 bit.

I want to put text like "360 nm 290 K, B ‖, ←" In comment cells through the worksheet. I am looking for the way to write the script line and have trouble to print special characters in Lab Talk.
I have just checked, that if I copy the "360 nm 290 K, B ‖, ←" string from worksheet comment cell to Lab Talk and then use it as argument (col(12)[C]$= "360 nm 290 K, B ‖, ←";), it works correctly, but the special characters are seen only as spaces in Lab Talk.
May be there is a direct way for writing special characters in Lab Talk?

Best regards,

Jonas

Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/05/2017 :  07:13:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jonas,

Origin 2018 supports the same mechanism as MS Word to enter Unicode characters. You can google and find links like

https://www.johndcook.com/blog/2008/08/17/three-ways-to-enter-unicode-characters-in-windows/

Basically you first enter Unicode code like 2192, then hold Alt and press X. This works in most places in Origin 2018, but may not be all. It certainly works on the worksheet, but if you find any situation that it did not work, please report back so we can fix it.

CP
Go to Top of Page

Chris D

428 Posts

Posted - 12/05/2017 :  6:22:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jonas,

You may experience that certain "characters" do not display properly (they may be a space or even a little block) even though they are actually correct and work in scripts as you describe. Here is the explanation.

Starting with Origin 2018 such characters are actually Unicode "code points". Unicode covers many tens of thousands of different "code points" but whether or not they actually displayed is dependent on the font used in whatever context they are being displayed. That is, some fonts contain glyphs for some Unicode code points while others don't. And while there is not single font that contains every single Unicode code point, some contain pretty much all that are of common interest.

So, for example, in Script Window, if you see blanks where you know valid characters are, that is because we haven't updated Script Window to better handle such situations. Code Builder is able to display many more of these characters, including cutting and pasting them but even it won't handle some of the less commonly used Unicode code points. The good news is those are generally not ones used in math, science, etc so it shouldn't be an issue.

BTW- the site listed below is an excellent resource for finding Unicode "characters" (e.g. it has an excellent free text search). You can copy and paste the actual character from that site in to Origin or get the Unicode "hex code" for Alt+X as @CP mentioned. If you see "U+210F", the hex code for Alt+X is the alphanumeric part after "U+". In this case it would be 210F.

https://codepoints.net/

I hope this helps.

Thanks,
Chris Drozdowski
Originlab Technical Support

Edited by - Chris D on 12/05/2017 6:25:24 PM
Go to Top of Page

JonasKlim

Lithuania
36 Posts

Posted - 12/06/2017 :  01:29:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Chris and CP,

Thank you for the very detailed answers.

Best regards,

Jonas
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000