There is a similar problem with the ASC() function.
The internal implementation appears to return a
"signed byte" value, whereas is should be using
"unsigned byte".
This is confirmed by the fact, that if you pass
a character with an ascii value of "255", then
Asc() returns "-1".
There are literally dozens and dozens of bugs like
this in AppGameKit! It would take me a week, to report
just the ones I've discovered myself.
Warning - flames and bad attitude inside
Yes, I should report them on the issues board. But
guess what TGC... I don't have the time to do that.
Once I've written a workaround for myself, I'm
done with the issue, and moving on.
Most of my bad attitude towards AGK comes from
the fact, that I don't see it as a very professional
development environment / Tier 2 library.
I hate the documentation which is oversimplified
and often not detailed enough, and I loathe the
bugs.
I'm used to working with much more professional
environments, with better documentation, and
think of AGK as a kiddie playground - especially
Tier 1!
This from a developer with over 30 years of
experience in C, C++, C#, Pascal and Assembly.
The fact that I'm still working with AGK, sometimes
amazes me. I'm not very impressed. Hell, even
the graphics library I developed myself in the 80's
for VGA DOS-games had several different sprite
blend modes (additive, subtractive, multiplicative,
color burn, etc) - yet blend modes are still not
even implemented in AGK.
Here's a workaround for anyone using Asc() with
extended character sets...
function FixAsc(a_strChar as string)
// Declare local variables
v_iASCII as integer
// Convert character to it's corresponding ASCII value
v_iASCII = asc(a_strChar)
// FIX: Workaround for ASC bug when using extended character set (char values above 127)
if (v_iASCII < 0)
// Fix the negated values...
v_iASCII = v_iASCII + 256
endif
// Return corrected result
endfunction v_iASCII
As for the issue with Upper() and Lower(), it is
very simple to create replacement functions which
rely on a lookup table, and work with extended
characters.
Oh, of course it would be nice if these issues
were reported on the issues board. They WON'T be
picked up here, as we've all been assured of
many times before.
http://code.google.com/p/agk/issues/list
Cheers,
AgentSam
The Grumpy Old Software Engineer