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

Autocompletion fails when names contain national characters

Unread post by Ferenc Nagy »

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: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

We will look at it.
Regards Thomas Linder Puls
PDC
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy »

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
Screen shot of incomplete autcompletion
Screen shot of incomplete autcompletion
autocompletion.png (14.34 KiB) Viewed 18718 times
TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

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: 215
Joined: 24 Apr 2007 12:26

Re:

Unread post by Ferenc Nagy »

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 18704 times
TIA, Regards,
Frank Nagy
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

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: 215
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy »

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: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

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