Lowercase Strings

5 posts / 0 new
Last post
macintricks's picture
Offline
Last seen: 5 years 1 month ago
Joined: Jun 22 2007 - 22:36
Posts: 30
Lowercase Strings
AttachmentSize
Image icon characters1.gif2.72 KB
Image icon characters2.gif2.71 KB
Image icon characters3.gif2.31 KB
Image icon characters4.gif2.31 KB

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:

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

  • Under standard Apple II emulation, it produces this output:

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

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

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


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!

mmphosis's picture
Offline
Last seen: 3 days 8 hours ago
Joined: Aug 18 2005 - 16:26
Posts: 433
Re: Lowercase Strings

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


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
Last seen: 5 years 1 month ago
Joined: Jun 22 2007 - 22:36
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.

Offline
Last seen: 9 years 10 months ago
Joined: Mar 27 2014 - 04:13
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
Last seen: 3 days 8 hours ago
Joined: Aug 18 2005 - 16:26
Posts: 433
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)&gt;127:PRINT"MOUSETEXT IS O"CHR$(70+8*M)CHR$(70-38*M)

Log in or register to post comments