LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Preserving a string character, σ, when cutting and pasting from a table.

Solved!
Go to solution

In my application I display a statistics table containing the σ character in the header.

 

 Stats.JPG

 

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

 

 

0 Kudos
Message 1 of 11
(3,648 Views)

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?

 

sigma1.png

 

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?

 

 

sigma2.png

 

 

Luis

0 Kudos
Message 2 of 11
(3,643 Views)

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.

0 Kudos
Message 3 of 11
(3,640 Views)

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

0 Kudos
Message 4 of 11
(3,635 Views)

Sorry, this doesn't work.  It just changed the character that is copied to ó.

 

 

0 Kudos
Message 5 of 11
(3,613 Views)

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.

 

0 Kudos
Message 6 of 11
(3,608 Views)

All you do is copy the sigma charater from the cell to notepad.

0 Kudos
Message 7 of 11
(3,601 Views)

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

0 Kudos
Message 8 of 11
(3,597 Views)

Ah, I'm using CVI 2009 and XP.  Let me go try it on Windows 7 and 2010 cvi.

0 Kudos
Message 9 of 11
(3,592 Views)
Solution
Accepted by topic author aml1138@yahoo.com

Okay, that worked with the Greek keyboard.  Thanks.

 

It's another good reason to move the customers over to Windows 7.

0 Kudos
Message 10 of 11
(3,590 Views)