Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error with NEWOBJECT()
Message
From
11/04/2008 10:58:24
 
 
To
10/04/2008 23:19:27
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
MySQL
Miscellaneous
Thread ID:
01308856
Message ID:
01309954
Views:
23
One problem that I see in using anything other than "A".."Z", "a".."z", "0".."9", and "_" in identifiers is that you run the risk of code not running in anything but the codepage you were using at the time when you originally wrote the code. This would especially be true with Asian languges like Chinese, Japanese and Korean -- mainly because of the double-byte character system used (where typically the "lead-in" characters are in the upper-ASCII range).

This reminds me of the rather puzzling problem we encountered. We were getting reports of users that were encountering numerous crashes from syntax errors from some of our customers. A review of the code in question showed nothing out of the ordinary, and everything seemed to check out fine. There was one thing that was common -- the customers reporting the problems were running in a Chinese-language version of Windows. Did a similar test to see if the same problem would occur in Japanese -- sure enough, the same problems would crop up in that environment. It was at that moment it became clear -- it's something to do with double-byte character encodings (both use double-byte encodings -- not the same encodings however. In fact, each of these languages has more than one encoding scheme -- often depending on the environment in which the text originated, so you sometimes have to fiddle around with the encoding settings to get the right one so your text appears correctly). Reviewing the code once more revealed what the problem was. The syntax errors were occurring in places where there were string constants that contain characters in the upper-ASCII range -- which are often used as "lead-in" characters for double-byte sequences. Essentially what was happening was whenever the character immediately preceding the closing quote was being intepreted as a "lead-in" for a double-byte character, the closing quote would get "eaten" -- thus resulting in the syntax error.

There is one other thing with double-byte characters that you could run into -- files that seem to be inaccessible because there are "illegal" characters in the filename. I've often seen this happen when you try to access discs that were originally meant for Japanese or Chinese systems and the files are named using double-byte sequences. Usually you can still access the file by the short DOS filename.

Of course all this would be moot if we were using Unicode...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform