Autocompletion fails when names contain national characters

Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Autocompletion fails when names contain national characters

Unread post by Ferenc Nagy » 18 Aug 2016 6:51

The compiler allows the usage of national characters in variable, constant and function names.
I have discovered a contradiction of the autocompletion with this feature.

The Hungarian alphabet uses accented vowels:
If I define names like
Verb (sparrow)
V
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 18 Aug 2016 10:13

We will look at it.
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy » 19 Aug 2016 4:25

Thomas,

The distributed version of the autocompletion collects the variable names in the clauses using a negative decision.
If the character is not in the {A..Z,a..z,0..9 underscore} set then the variable name has ended.
The patching of this set is tiresome. The list would be toooooooooooo looooooong. The danger that you forget a national character is apparent.

This positive decision will collect the whole national names:
If the character is in the set of separators {space, tab, newline, comma, semicolon, colon, period, parentheses, brackets} set then the variable name has ended.
Attachments
autocompletion.png
Screen shot of incomplete autcompletion
autocompletion.png (14.34 KiB) Viewed 3218 times
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 20 Aug 2016 22:31

Thank you. But actually I think we can handle this :-): it should work in the same way as the compiler.
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Re:

Unread post by Ferenc Nagy » 21 Aug 2016 6:58

Thomas,
Thomas Linder Puls wrote:Thank you. But actually I think we can handle this :-): it should work in the same way as the compiler.
Indeed. I do not know how the complier collects the variable names but it collects them correctly. I attach the autocompletion of control names of a form defined during the automatic code generation.

Code: Select all

 
Attachments
autocompletion of earlier defined names.png
autocompletion of earlier defined names.png (6.96 KiB) Viewed 3204 times
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 22 Aug 2016 8:25

We use the Windows API function IsCharAlpha.

It is available through string_native:

Code: Select all

predicates     isCharAlpha : (char Character) -> booleanInt BOOL language apicall.     % @short See IsCharAlpha in MSDN.     % @end
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy » 23 Aug 2016 10:36

Thomas,
Thanky you for the mentioning of string_native library.
There are so many classes in the PFC which I have overlooked.
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1622
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 23 Aug 2016 18:08

Normally, you should not use the _native classes directly, but it is not always that we get things mapped all the way to the "user" level.

The predicate string::hasAlpha does the same just for an entire string, i.e. it uses isCharAlpha on all the characters in the string and succeeds if they are all "alpha".
Regards Thomas Linder Puls
PDC

Post Reply