Lowercase Strings

4 replies [Last post]
macintricks's picture
Offline
Joined: Jun 23 2007
Posts: 30

Thanks to all of you who advised me on my previous BASIC question. I have a new question for you regarding the interpretation of BASIC strings with lowercase characters on various Apple II configurations. The first thing I should point out is that I'm using an emulator (AppleWin at the moment) which can assume the identities of a standard Apple II and an Enhanced Apple IIe.

Here is the problem:

  1. Using A2Forever's little program to generate the ASCII range on-screen, I produced this output on the Enhanced IIe:

    characters1.gif

  2. Under standard Apple II emulation, it produces this output:

    characters2.gif

    Okay, so am I understanding correctly that the lowercase set on the IIe is repeated as uppercase on the standard II?

  3. Now say I write a program with lowercase strings on the IIe.

    characters3.gif

  4. Listing and running this same program (programmed on the IIe) on the standard Apple II produces this:

    characters4.gif

While posting this, I think I've answered my own question. In the first two screens, the differences begin after the underscore character "_". I originally thought the standard Apple II had repeating sets of uppercase characters to cover the absence of lowercase, but this is not true. The character positions in the first and second screens tell me that punctuation characters on the standard II cover part of the lowercase set on the IIe. So the ASCII mapping isn't the same. Duh.

Besides telling me to only program strings in uppercase, is there a way to remap characters when moving them from system to system? Your advice is appreciated!

AttachmentSize
characters1.gif2.72 KB
characters2.gif2.71 KB
characters3.gif2.31 KB
characters4.gif2.31 KB
__________________

Apple IIc, Macintosh LCII (Apple IIe Card), Macintosh IIci

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mmphosis's picture
Offline
Joined: Aug 18 2005
Posts: 316
Re: Lowercase Strings

http://dogic.blogspot.ca/2006/09/cutting-edge-of-yesteryear.html

mmphosis wrote:

There are 255 characters that can be displayed on the Apple II 40 column text screen. Here they are:

00-3F: 64 INVERSE upper case and punctuation characters.

40-7F: 64 FLASH upper case and punctuation characters.

80-9F: 32 NORMAL upper case (control) characters. "Mouse Text" characters on Apple IIe and later when enabled.

A0-DF: 64 NORMAL punctuation and upper case characters. (Regular ASCII with the hi-bit set.)

E0-FF: 32 NORMAL punctuation (lower case) characters.

The upper case characters are "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_" with ASCII values 40 to 5F in hex.The punctuation characters are " !"#$%&'()*+,-./0123456789:;<=>?" with ASCII values 20 to 3F in hex.

As for remapping characters:

"be strict in what you write and liberal in what you read."

For keyboard input, I often accept lower case keys and map them to upper case. The lowest common denominator would be to use upper case in your programs and output because it should work on all models. However, for output, you could check the system type and display the characters that best suit the system, or display the text using graphics, but then again use the best graphics mode for each system. Ideally, you also could keep separate forms / programs / strings targeted to different systems much like is done with internationalization in software development.

macintricks's picture
Offline
Joined: Jun 23 2007
Posts: 30
Re: Lowercase Strings

Now that's something I hadn't thought of: detecting the system type to decide the program's output. You've given me a good starting point there! Thanks.

__________________

Apple IIc, Macintosh LCII (Apple IIe Card), Macintosh IIci

Offline
Joined: Mar 27 2014
Posts: 3
Re: Lowercase Strings

The previous basic question were indeed important for me and for me those were advanced level questions. This is technical post which should be regular.

mmphosis's picture
Offline
Joined: Aug 18 2005
Posts: 316
Re: Lowercase Strings

Display all 256 characters on the text display ...

HOME : FOR I = 0 TO 7 : VTAB I + 1 : FOR J = 0 TO 31 : POKE PEEK(40) + PEEK(41) * 256 + 4 + J, I * 32 + J : NEXT J, I

The following code works for Apple II models that have MouseText ...

POKE49166,0:REM TURN MOUSETEXT OFF

POKE49167,0:REM TURN MOUSETEXT ON

Indicate whether MouseText is on or off ...

M=PEEK(49182)>127:PRINT"MOUSETEXT IS O"CHR$(70+8*M)CHR$(70-38*M)