#Benchmark print at?
10 messages in this thread
I am working on converting a COMAL program that plays a game of NIM to
Modula-2. COMAL allows one to use: PRINT AT 14,9: "|____| |____|" abd the like
to set up the boxes, and then the program upgrades the number of stones in each
box using an algorithm which employs PRINT AT.
Is there a word for PRINT AT (row,col) in Modula-2? If not, how would I
write a module to do that and what would I need to do to have it work?
Now that MYTECH is actually BETA testing an Amiga COMAL, modules to implement
COMAL words would be useful in porting programs.
Thanks.
// Jim
Since you're using Benchmark, you can use the SimpleConsole and
SimpleConsoleCmds modules. These contains various procedures to do things
within a console window. They might do the trick for you. If not, it should
be trivial to construct a PRINT AT command using the available procedures.
– Steve –
Steve–
Trivial for whom?
I will probably benefit from struggling with it. As a general "philosophical"
thing, does it make sense to use Benchmark's extra "goodies," or do you think
it would be better to use plain vanilla m2? I probably will never write
publishable code, so portability is not an economic issue, but one wants a
certain purity in one's hobbies, I guess.
BTW, how would _you_ code a print at? 🙂
// Lazy Jim
Jim,
I personally would use the SimpleConsole and SimpleConsoleCmds modules for
the job (unless you want to use graphics). The way I figure it… if you have
the tools, use them, and let those without the tools either get them or write
their own.
So… open a window, attach a console, then use wClrScr(), wHome(), wPos() to
do the tricks.
Regards, Larry.
Thanks, Larry. I am having some truble finding my way around the Benchmark
manuals, but I will look for SimpleConsol pages.
Any sign of COMAL yet?
// Jim
Jim,
try Vol II for the library descriptions. They are in alphabetical order, and
there is a master index in the back of Vol II that lists all PROCEDUREs and
tells you which library they are defined in.
COMAL arrived tonight. I drove down to the airport ot pick it up, and only
had a chance to play with it for about 15 minutes. Have some suggestions
already. It is quite good for a beta, and it really is COMAL!!! I was beginning
to think I would never see it again. <grin>
Regards, Larry.
Thanks, Larry. I will look in these procedures. Would one define a procedure
for PRINT AT same as in COMAL?
Ain't it GRAND to have COMAL on Amy?? Now the project of translating from
COMAL to Benchmark becomes important for me. I think that if the COMAL editor
is fixed up I will want to use COMAL for prototyping and then translate–if I
ever figure out how–for situations where speed matters.
BTW–don't try to divide by zero or use MOD to the same effect, you will get
the guru.
Looking forward to hearing about YOUR discoveries.
// Jim
Jim,
Probably a procedure would be the best way to go in M2, a call something like
PrintAt(x,y,"here be good place for text"), and the procedure itself would
simple use the wPos to set up to the first two parameters and a WriteString()
for the last one.
As for translating, it shouldn't be overly difficult, or at least not as
difficult as translating C to M2. There are a few gotcha's to do with scope of
variables, but they should be relatively straightforward.
Regards, Larry.
Larry,
Amiga COMAL. Speed? Size? Functionality? Projected Availability?
And a million other questions………
Lloyd
Lloyd,
Bearing in mind that this is a beta test version, and that the answers will
certainly change between now and release… about 130K, pretty good speed,
functionality = COMAL, and who knows when? It looks like an excellent start,
and if they come through with some of the projected plans they have for it,
should be popular.
Regards, Larry.