Display chr$(30) & chr$(31) 
Author Message
 Display chr$(30) & chr$(31)

Can anyone explain to me why QB can display these characters in the help
screens, but I cannot reproduce them on-screen?
They may be useful occasionally as direction pointers.

Regards
Norman Buxton



Sun, 01 Nov 1998 03:00:00 GMT  
 Display chr$(30) & chr$(31)

Quote:

> Can anyone explain to me why QB can display these characters in the help
> screens, but I cannot reproduce them on-screen?
> They may be useful occasionally as direction pointers.

Hello, If you want to reproduce them, the only way will be to go into the
help menu where it shows the characters, then hold shift down and go over
the character, then press Ctrl-Insert.  Then go to your program and press
Shift-Insert, and there you have it!!!

Ryan Doherty

--
Ryan Doherty
(((Saber)))
SysOp of SaberSpace BBS at (613)731-8751
The truth is and always will be... out there...



Mon, 02 Nov 1998 03:00:00 GMT  
 Display chr$(30) & chr$(31)

Quote:

> Can anyone explain to me why QB can display these characters in the help
> screens, but I cannot reproduce them on-screen?
> They may be useful occasionally as direction pointers.

> Regards
> Norman Buxton

They are control characters. Like chr$(13), they are used to represent
carriage returns, line feeds, cursor movements, clear screen, etc.

You can make a direct POKE at screen to show this characters.

In stead of:

LOCATE 1,1: PRINT CHR$(30)

You would use:

DEF SEG = &HB800
Li = 1
Co = 1
ZZ = 10
POKE (((Li-1)*160)+((Co-1)*2)+ZZ), 30

Eek! That's difficult. :)

You might have to calibrate the ZZ variable to work with your screen (I
don't remember the value, hehe)... It might be something from 0 to 20.
Don not use odd values like 1 or 5 in the ZZ, they are for the color
value of the char on the screen.

Regards
--
----------------------------------------------------------------------
-- Jose Fernando [Rorshack]         Milenium BBS [ANSi Coordinator] --
--                                  Vector BBS           [GABME 01] --
-- Head Banger - Inline Skater - ANSi Artist - QBasic 45 Programmer --
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---

----------------------------------------------------------------------



Tue, 03 Nov 1998 03:00:00 GMT  
 Display chr$(30) & chr$(31)


Quote:


>> Can anyone explain to me why QB can display these characters in the help
>> screens, but I cannot reproduce them on-screen?
>> They may be useful occasionally as direction pointers.
>Hello, If you want to reproduce them, the only way will be to go into the
>help menu where it shows the characters, then hold shift down and go over
>the character, then press Ctrl-Insert.  Then go to your program and press
>Shift-Insert, and there you have it!!!

 Well let's see. To access non-standard ASCII characters, you can do
 several things.

 1.) Copy and Paste as mentioned above
 2.) Press CTRL+P, then hold down ALT and enter the 3 digit code
 3.) Use CHR$(3 digit code)
 4.) Press CTRL+P and the correct CTRL+? sequence, however these 2 characters
     in particular aren't possible this way, I don't think.

  IE
 2. CTRL+P, ALT+030 or ALT+031
 3. CHR$(30) or CHR$(31)



Tue, 03 Nov 1998 03:00:00 GMT  
 Display chr$(30) & chr$(31)

Quote:

> Can anyone explain to me why QB can display these characters in the help
> screens, but I cannot reproduce them on-screen?
> They may be useful occasionally as direction pointers.

> Regards
> Norman Buxton

This is a GREAT question and the answer is just GREAT too.

Make this:

PRINT ""

Go to the "". NOW, press Ctrl-P, and so type ALT-30 on the numeric
 pad. VOILA! When You Use ^P, you can type any character and the
character will be show! Just put this arrow in the "" and that's ok!
:-)

Regards
--
----------------------------------------------------------------------
-- Jose Fernando [Rorshack]         Milenium BBS [ANSi Coordinator] --
--                                  Vector BBS           [GABME 01] --
-- Head Banger - Inline Skater - ANSi Artist - QBasic 45 Programmer --
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---

----------------------------------------------------------------------



Tue, 03 Nov 1998 03:00:00 GMT  
 Display chr$(30) & chr$(31)

Quote:

> Can anyone explain to me why QB can display these characters in the help
> screens, but I cannot reproduce them on-screen?
> They may be useful occasionally as direction pointers.

Because QB's PRINT routine interprets these characters as control
characters meaning "move the cursor up one line" and "move the cursor down
one line", respectively.  The QB Help screens don't use Basic's PRINT
routine.

If you need to display these characters, you can do so by opening CON
(the DOS console driver) or CONS: (the Basic "console" device, which is
actually DOS stdout), and printing to them, or by writing directly to
screen memory.

Bear in mind, however, that CON and CONS: don't print in the current text
color, the way PRINT does (although if ANSI.SYS is installed, they may
print in some other color!), and, although they print at the current
cursor position and advance the cursor, PRINT will be unaware of any
changes they make in the cursor position.

Also, if the user redirects stdout to a file, both PRINT output and CONS:
output will be redirected, but CON output won't.

---
Glen Blankenship




Tue, 03 Nov 1998 03:00:00 GMT  
 Display chr$(30) & chr$(31)


Quote:

>Subject: Re: Display chr$(30) & chr$(31)
>Date: 17 May 1996 16:49:41 GMT



>>> Can anyone explain to me why QB can display these characters in the help
>>> screens, but I cannot reproduce them on-screen?
>>> They may be useful occasionally as direction pointers.
>>Hello, If you want to reproduce them, the only way will be to go into the
>>help menu where it shows the characters, then hold shift down and go over
>>the character, then press Ctrl-Insert.  Then go to your program and press
>>Shift-Insert, and there you have it!!!
> Well let's see. To access non-standard ASCII characters, you can do
> several things.

> 1.) Copy and Paste as mentioned above
> 2.) Press CTRL+P, then hold down ALT and enter the 3 digit code
> 3.) Use CHR$(3 digit code)
> 4.) Press CTRL+P and the correct CTRL+? sequence, however these 2 characters
>     in particular aren't possible this way, I don't think.
>  IE
> 2. CTRL+P, ALT+030 or ALT+031
> 3. CHR$(30) or CHR$(31)

The problem is that even if can include them in your program, they are treated
as print control codes when you print them to screen. All that will happen
when you PRINT CHR$(30) is that you move the cursor up by one line and
CHR$(31) moves it down one line. To see the effect try:
LOCATE 4,1:PRINT "XXX"+CHR$(30)+"XXX"+CHR$(30)+"XXX"
This will give you
      XXX
   XXX
XXX
(view this with a monotype font of course)

--
Disclaimer?? The opinions of the writer ARE the opinions of Lexacorp!!
----------------------------------------------------------------------
LEXACORP Pty Ltd, Brisbane, Qld Australia
Dataflex/MSAccess/Basic System Development



Wed, 04 Nov 1998 03:00:00 GMT  
 Display chr$(30) & chr$(31)

Quote:
>> 1.) Copy and Paste as mentioned above
>> 2.) Press CTRL+P, then hold down ALT and enter the 3 digit code
>> 3.) Use CHR$(3 digit code)
>> 4.) Press CTRL+P and the correct CTRL+? sequence, however these 2 characters
>>     in particular aren't possible this way, I don't think.
>The problem is that even if can include them in your program, they are treated
>as print control codes when you print them to screen. All that will happen

 Whoops, I forgot to check the codes, yes control codes will not show the
 character using PRINT, although they won't show it by cutting and pasting
 them in from help using PRINT either. I thought the original responder
 had tried his methods and just wasn't aware of the others.

Quote:
>when you PRINT CHR$(30) is that you move the cursor up by one line and
>CHR$(31) moves it down one line. To see the effect try:

 In these cases, the only way is to use direct memory writes.

 SUB DMWrite (Ascii%)
   IF (Ascii% > 255) OR (Ascii% < 0) THEN EXIT SUB
   Offset% = ((POS(0) - 1)* 160) + ((CSRLIN - 1) * 2)
   DEF SEG = &HB800                            '&HB000 for monochrome
   POKE Offset%, Ascii%
   DEF SEG
 END SUB

 Of corse this assumes you are using TEXT Mode and have not changed the
 memory page, if you need it for other modes/ multiple pages, I suggest
 learning ASM. Actually, using the BIOS INTERRUPT (&H10) service &H0A may
 bypass all the trouble for you, I hadn't thought of that.

 SUB CharWrite (Ascii%)
   IF Ascii% > 255 or Ascii% < 0 THEN EXIT SUB
   Dim R as RegType

   R.AX = &Hf00                 ' get current display page
   INTERRUPT &H10, R, R         ' and set up BX register for next interrupt
   R.BX = (R.BX AND &HFF00) OR 7'

   R.AX = &H0A00 OR Ascii%      ' Set up AX
   R.CX = 1                     ' Set up CX
   INTERRUPT &H10, R, R         ' Call Interrupt
 END SUB



Wed, 04 Nov 1998 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Display unprintable character (ASCII values 30 and 31)

2. Help with control characters (CHR$(1-31))

3. Chr(10) & Chr(13)

4. CHR vs CHR$

5. chr(10) and chr(13) in memofield gives |

6. Difference between chr(34) and chr(160)

7. Chr(10) and Chr(13) doesn't work

8. is carriage return chr(13) or chr(32)

9. INPUT OR READ TO STRIP CHR(10) AND CHR(13)

10. What is chr$(13) + chr$(10)

11. vbCRLF = chr(13) + chr(10)

12. trim & chr error

 

 
Powered by phpBB® Forum Software