Converting the Collision characters in application (OpenInsight Specific)
At 20 OCT 1998 04:56:28AM Peter S. Kassinski wrote:
I have one problem. Some simbols in all standard Windows Character Sets in my native language
are "collision" characters. I have read some documents concerning this problem, but didn't understand what place in my application I can insert program code with convertion "collision" characters, using Get_ ,Set_Property for Charmap property ?
My question is "What place of my application I need design using program code for auto-convertion "collision" chars, when I input simbols to my tables ? "
Many thanks
Peter
At 20 OCT 1998 06:40AM Oystein Reigem wrote:
Peter (Pjotr?),
I too was confused by this. I thought that my app had to make sure a Set_Property CHARMAP was run every time it started. I thought I had to put a Set_Property CHARMAP some place early in my app, e.g in the CREATE handler of the startup window.
But it's not like that. You run Set_Property CHARMAP once, and the setting sticks.
I don't know why this is done differently from the other language settings, i.e with a Set_Property and not by editing/changing some row in SYSENV.
It might still be a good idea to have a Set_Property CHARMAP in the CREATE handler of your startup window, though.
I have not yet started using the bi-directional CHARMAP for real, mainly because OIPI (printer functions from Splaver Software) cannot handle the new CHARMAP yet.
- Oystein -
PS. Which character set do you use? See e.g this page.
At 21 OCT 1998 02:42AM Peter Kassinski wrote:
Hello Oystein !
Thank you for your attention.
I'm very surprised by the next event.
I performed next program :
Subroutine New_Map(null)
declare function Get_Property
declare subroutine Set_Property
declare subroutine Message_Box
$insert Message_Box_Equates
Map=Get_Property("SYSTEM","CHARMAP")
Map250,1=1"
Map251,1=2"
Map252,1=3"
Map253,1=4"
Map254,1=5"
Map255,1=6"
Set_Property("SYSTEM","CHAPMAP",Map)
Map_1=Get_Property("SYSTEM","CHARMAP")
Message_Box(@window,Map_1250,1,"Activated",MSG_ICON_INFO$)
end
I think that this program must print simbol "1", but it print again collision character ! What wrong - Set_Property for CHARMAP or my brains ?
P.S. My native name is PETR, character set - Cyrillic.
At 21 OCT 1998 09:12AM Oystein Reigem wrote:
Peter,
First mistake: CHARMAP is an array with two parts, each of length 255. The first part describes the input conversion - how characters keyed in by the user are stored in the database tables. You forgot the second part which describes the conversion the other way.
Second possible mistake: Which characters are you trying to store the collision characters as? The characters "1", "2", etc, or the control characters ASCII 1, ASCII 2, etc? You seem to say it's the first. (I assume this is just a test and not what you'd want to do in real life, unless you have a database devoid of numeric data
.) But if you mean characters "1", "2", etc, you must believe the values in the CHARMAP arrays are *character* values. They are not. They are *integers*. (Except BASIC+ variables store integers as strings…) So if you want to use CHARMAP to store something as the character "1", you have to specify Seq("1"), or 49. What you now get is ASCII 1. - I apologize if ASCII 1 is what you really mean, but if you do, you might want to reconsider and choose other replacement characters. I have a feeling control characters in database tables can be problematic, but I cannot really remember why. Except ASCII 0 must be avoided.
Sprezzatura issues the SENL newsletter which in its Volume 2 Issue 2 describes the bi-directional CHARMAP very well. You might want to read that. Except there is an error and the two parts of CHARMAP are switched in the programming example. - I think SENL's suggestion for replacement characters is a good choice.
Also you might want to read the caveats I've posted on the discussion list.
- Oystein -