Position failure

Hi
As a part of code for license code generating/decoding I have this command (simplified):

$LetterReceived:=“Ø”

$LetterPosition:=Position($LetterReceived;“ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ”)

With 4D version 14 the result was 28. Which was correct.

4D version 17.3 is returning 15. The position og the letter “O”. Version 17.3 fails to distinguish between “O” and “Ø”.

I have not checked “Å” and “Æ”.

: Bjørn Arve IVERSEN

$LetterPosition:=Position($LetterReceived;“ABCDEFGHIJKLMNOPQRSTUVWXYZÆ
Å”)

try instead
<code 4D>
$LetterPosition:=Position($LetterReceived;“ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ”;*)

</code 4D>
mind the asterisk *

This shouldn’t be changed since 4D v11. So I don’t understand why did you get another result with v14?

Regards
Lutz

Strict comparaison with * is faster, BTW…

: Lutz EPPERLEIN

This shouldn’t be changed since 4D v11. So I don’t understand why did
you get another result with v14?
Swiched to unicode?

Hi and thanks for answering.

It seems to return correct value using the asterix, but I have not used that earlier. Not in the code generator and not in the “decoding” code — but I will try this.

I did not thought tha was necessary using Unicode.

But it seems to work so thanks again.

Best regards
Bjørn Arve
Zoft Zircus

Hi and thanks for answering.

May be it is something connected with Catalina or can it be the «data language settings». I see that it is set to English. I think it may have been Norwegian.

SET DATABASE PARAMETER(Unicode mode;1) // Added: BAI 30-12-2010

Thank you anyway. It seems to work when I add the asterix after the command:

$BokstavPosisjon:=Position($BokstavMottatt;“ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ”;*)

Thanks for help
Bjørn Arve
Zoft Zircus