05-04-2011 11:28 AM
In my application I display a statistics table containing the σ character in the header.
When I do a cut and paste from the table the σ is pasted as s. See below
Min Max Mean s 3s
Birefringence 91.720 140.399 116.0106 9.4890 28.4669
Retardation 45.860 70.199 58.0053 4.7445 14.2335
Angle -29.01 -17.26 -22.603 2.0265 6.0796
Is there a way to preserve the σ character when I cut and paste?
Thanks
Solved! Go to Solution.
05-04-2011 05:26 PM
How are you copying that character from the table? It's not possible to select a column label in a CVI table, at run-time, in order to copy its text. The best I can do is to copy it from the Edit Table dialog in the UI editor, as shown below. Is this what you did?
In order to even be able to insert that character in the table column, I had to change the character set of the column label font to be Greek, as shown below. Doing this usually ensures that copy/paste operations to and from that label can preserve any characters that are specific to the particular character set. Have you tried doing that with your table?
Luis
05-04-2011 05:35 PM
This is from the users point of view and the exe is running. When I built the table I selected the symbol font so that the σ character is shown in the cell. But when the user selects the cell and copies it to the clipboard it is changed to s. I'm assuming that's because 1) It's not Unicode and 2)Windows doesn't recognise the font.
I was hoping that I could use a font that would maintain the σ to the clipboard.
05-04-2011 06:49 PM
Ah, okay. That makes more sense now. I had thought that the σ was in in a table column, but it looks like it's in a cell instead.
If you're using the symbol font, internally, that character is always an 's'. (ascii code = 115). It just so happens that the symbol font displays that character code as a sigma, instead of an 's'. But as far as your application is concerned, and as far as the clipboard is concerned, it'll always be character code 115, which will be rendered as an 's' by any application that is not also using the symbol font.
The proper way for you to do this is to not use the symbol font, and to set that cell label's character set to Greek, and to enter the actual code for the sigma (ascii code = 243) when you set the cell's value. You can enter this code by setting your keyboard mapping to Greek, or by pasting it directly from some other application. Then, when your user copies the label to the clipboard the correct code should be copied, and the character set information along with it, so that when it is pasted onto a unicode application, it will be interpreted as a sigma.
Keep in mind that ascii code 243 corresponds to a sigma only in the context of the Greek character set. If you use a different character set, that code will correspond to some other symbol altogether.
Also, I've been assuming that you're using a version of CVI that supports multiple character sets (9.0 or later). If you're using an older version, then there really isn't a good solution.
Luis
05-06-2011 10:03 AM - edited 05-06-2011 10:05 AM
Sorry, this doesn't work. It just changed the character that is copied to ó.
05-06-2011 11:01 AM - edited 05-06-2011 11:02 AM
Can you attach a program snippet that reproduces this behavior? And also let me know which version of CVI and which OS you're using, including the language of the OS.
05-06-2011 11:03 AM
All you do is copy the sigma charater from the cell to notepad.
05-06-2011 11:34 AM
And that works for me, using CVI 2010 in Windows 7 English, when copying the text from a control on the UI Editor.
The reason I asked you for an example is so that I could see if the problem had anything to do with how the character ended up in your control, or if there was some other setting of your control that might be relevant. If you attach a small example that reproduces the problem, and if you tell me which version of CVI you're using, I can investigate it further. Otherwise, I can't think of anything else to suggest.
Luis
05-06-2011 11:49 AM
Ah, I'm using CVI 2009 and XP. Let me go try it on Windows 7 and 2010 cvi.
05-06-2011 12:05 PM
Okay, that worked with the Greek keyboard. Thanks.
It's another good reason to move the customers over to Windows 7.