Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Misc > QBASIC CHR$ com...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 1387 of 1466
Post > Topic >>

QBASIC CHR$ command to move cursor to the left?

by Peter Knutsen <peter@[EMAIL PROTECTED] > Nov 17, 2007 at 12:08 AM

Is there a CHR$ command in MS QBASIC to move the cursor one step to the 
left?

I'd like to include a "progress timer" in a little program, and I 
thought it could be cute if it was a line that got filled out slowly, 
first with a grey minus (-), then the minus replaced with a grey plus 
(+), then the grey plus replaced with a white plus (+).

(Maybe dark grey first, then light grey, then white, then change minus 
to plus?)

I could do that with LOCATE, but I'd prefer to avoid having to use that 
command for this particular program.

I'm pretty sure that way back in the old days, Amstrad Locomotive Basic 
1.0 (for the CPC 464) could do some *very* fancy things with the CHR$(X) 
function for values of X lower than 32.

Can QBASIC do something similar? All I know about are 7 which is the 
bell, and 32 which is a space.

I'm thinking I could do

PRINT "-";
for n=1 to 5000 : next n
print CHR$(X);"+";

Where X is the correct value to move the cursor one step to the left. 
That would print an "-", then later overwrite the "-" with a "+".

But can that be done? If yes, what is the correct value for X?

If it can' be doe via CHR$, is there another way to do it? Keeping in 
mind that I have no idea what the screen will be like, which is why I 
can't very well use LOCATE.

I could drop the colours and just write 10 or 20 or even 79 minuses, one 
after another. but that would fail to let the reader know how long the 
progress bar has to become before the task is finished, unlike if I 
first "fill out" with dark grey, and then use light grey and white for 
the progress.


The alternative is to create what I'd guess is called a pseudo-console, 
to control everything that goes onto the screen (so that I could reserve 
the rightmost column, # 80, for this "progress bar", ensuring that all 
text wraps at or before column #79), which would rather be overkill for 
my current needs, although I did write a very primitive pseudo-console 
in QBASIC, IIRC in 1999. (It split the screen up into 3 columns, for a 
very task-specific RPG dice rolling program.)

Or is it possible to force QBASIC to wrap lines at the 60th or 65th 
column instead of the 80th? I believe that was possible in Locomotive 
BASIC, but I never did play around at all with its WINDOW command.

-- 
Peter Knutsen
sagatafl.org




 9 Posts in Topic:
QBASIC CHR$ command to move cursor to the left?
Peter Knutsen <peter@[  2007-11-17 00:08:59 
Re: QBASIC CHR$ command to move cursor to the left?
Eric <englere_geo@[EMA  2007-11-16 15:19:39 
Re: QBASIC CHR$ command to move cursor to the left?
Peter Knutsen <peter@[  2007-11-17 00:58:26 
Re: QBASIC CHR$ command to move cursor to the left?
ArarghMail711NOSPAM@[EMAI  2007-11-16 19:03:24 
Re: QBASIC CHR$ command to move cursor to the left?
"news@[EMAIL PROTECT  2007-11-16 15:38:15 
Re: QBASIC CHR$ command to move cursor to the left?
Peter Knutsen <peter@[  2007-11-17 00:57:20 
Re: QBASIC CHR$ command to move cursor to the left?
Peter Knutsen <peter@[  2007-11-17 01:02:52 
Re: QBASIC CHR$ command to move cursor to the left?
ArarghMail711NOSPAM@[EMAI  2007-11-16 19:04:16 
Re: QBASIC CHR$ command to move cursor to the left?
ArarghMail711NOSPAM@[EMAI  2007-11-16 19:00:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 11:00:00 CDT 2008.