Howdy. I'm working through "Java 2 Weekend Crash Course" from idg. It's aimed at wintel, I'm on mac. Most things have worked fine, but one sample prog has me baffled. It's supposed to start with ascii 0x10 and use a while loop to get up to ascii 0x20, printing the appropriate character to the screen on each iteration of the loop; instead it just prints a new line for each iteration. When I amend the code to concat a string onto the expected ascii I get my string preceded by the little box that seems to mean "control character" on mac. I was hoping someone here might be able to give me a clue; all help appreciated. Thanks!
um, i never experienced with mac, but i think your problem is around the line-separator. in windows, the line separator is "\r\n", unix is "\n" and in mac, it's "\r". try printing those line separators and check whether the weird box shows up. this is not a solution, but i hope this can do a little help cyao !
Joined: May 21, 2001
My bad; turns out the script works just fine, I just don't know my ascii well enough. 0x10 --> 0x20, according to my little ascii character-set table, are all blanks!! What a stupid example! I re-did the code, using 0x50 --> 0x70, it worked like a charm, priting P --> o. Looks like what I need is an ascii refresher...