[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTAB won't work!! My strings aren't printing right!! My program isn't working!!!



> That is because HTAB is really a 40-column command, which the
> 80-column firmware tries to interpret as well as it can. When in 80
> columns, the value of location 36 ($24) is always 0, unless you
> perform a HTAB with a value other than 1, in which case the firmware
> takes this value and puts it in its own CH location at 1403 ($057B).
> The problem is that Applesoft does not know anything about 80
> columns. It was designed with 40 columns in mind and that's what it
> still thinks the system is. The 80 column firmware works very hard to
> have Applesoft print to 80 colums in a civilized way, but it is not perfect.
> Solution: bypass HTAB and poke the value you want into 1403 directly
> (zero based, so you must subtract 1).

After I posted this I looked at some files I have and found the locations.
I changed the program so that it both HTAB/VTABbed to a location and POKEd
the values into 1403 and 1531. That solved the problem.

I always do this. I post a question, then I find the answer to it on my
own an hour later.

> If you don't want to give up 40
> column compatibility, *also* poke the value into 36.
> 
> Having said this, we may have a problem.
> Because I typed in your program:
> 
> > 170 FOR X=1 TO N
> > 175 H=INT((X-1)/18):V=X-(H*18):H=H*21:H=H+1
> > 180 HTAB H:VTAB V+3:PRINT ST$(X)
> > 185 NEXT X
> 
> And it simply works the way you want it to.

Not for me. The first column is displayed diagonally.

> Now the 40/80 conflict I
> described above could *only* account for the very first string being
> misplaced, because after the PRINT command, the CH counters are all
> back to zero and there can be no mistake about where to display the
> next output. So that can't be the problem.
> Therefore, the problem lies elsewhere.

Actually, it doesn't.

> - are you sure the text window is wide enough to display everything
> you want where you want it?

Yes, the window is wide enough.

> - are you sure 80 colums was initialized correctly? (I.E. by
> performing a PR#3, or a call to 49920. You can trick the system into
> thinking it has 80 columns by doing a POKE 49165,0. After this, at
> least on a IIgs, half the system thinks it's in 80-column mode. Don't
> try this at home. And make sure there isn't a hidden PR#0 somewhere
> in your program. On some configurations, PR#0 does not switch back to
> 40 columns, so you may not have noticed.)

Yes, the firmware was initialized correctly, and no, there isn't a PR#0
anywhere. I don't use PR#0 to switch back to 40-column mode; I use PRINT
CHR$(21) like I should.

> - are you sure there aren't any cursor moving commands in your
> strings? For instance, a string consisting of "ABC"+CHR$(25)+"DEF"
> can mess up your layout pretty nicely if that wasn't your intention.

No, there aren't any cursor-movement commands in my strings.

> - Hm, I just remembered, on some older machines, HTAB with a value
> greater than 40 will not work properly either on the 80 column
> screen. I.E. with a HTAB 60 the monitor routines think that you want
> to go to position 20 on the next line. Is that what's happening on
> your computer? What model is it?

I'm running this program off an emulated Apple IIc.

-- 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
jonrelay@napanet.net                        dimension18.cjb.net
"Remember, if it's not a secure web server, it's an _insecure_
web server!"                                              -- Me

 *_     Syntax Error: an error on a criminal's tax record.
   |    Bad Subscript: a criminal reading a book on a subway.
  ---   Unimplemented Trap: when a bear trap isn't set up 
 |' ,|  properly and thus does not work.
  ---   Overflow: too many ice cubes.      <Can't Restart>

Figure 1.1: Most Applications Crash - If Not, The Operating
            System Hangs

               I just upgraded to System 7.6!
          Don't forget: Tammy Day on February 15th!
Please remove capital letters from my e-mail address to respond.