Send Ctrl-Z to Com Port using MSComm 
Author Message
 Send Ctrl-Z to Com Port using MSComm

Hi all,

I wish to send the Ctrl-Z and Ctrl-E keys to the Comm port.  Something
like this

     MSComm1.output = "^Z"
or
     MSComm1.output = "{CTRL}Z"

But I can't get any of them working.  Anybody got any ideas?

Thanks for the help,
Jim

P.S.  What is the best way of storing passwords?  If I write them
      to a file as text, anybody and everyone will be able to read
      them.  I want to be able to read them back as well.
      Any ideas?

+-----------------------------------------------------------------+
| Jim Barrett,                          Title:  Software Engineer |

| Neptune House,                        Phone:  +353-21-317001    |
| Victoria Road,                        Fax:    +353-21-313603    |
| Cork City, Ireland.                   Mobile: +353-87-573121    |
+-----------------------------------------------------------------+



Sat, 05 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm

mscomm1.output = chr(13)

Quote:

>Hi all,
>I wish to send the Ctrl-Z and Ctrl-E keys to the Comm port.  Something
>like this
>     MSComm1.output = "^Z"
>or
>     MSComm1.output = "{CTRL}Z"
>But I can't get any of them working.  Anybody got any ideas?
>Thanks for the help,
>Jim
>P.S.  What is the best way of storing passwords?  If I write them
>      to a file as text, anybody and everyone will be able to read
>      them.  I want to be able to read them back as well.
>      Any ideas?
>+-----------------------------------------------------------------+
>| Jim Barrett,                          Title:  Software Engineer |

>| Neptune House,                        Phone:  +353-21-317001    |
>| Victoria Road,                        Fax:    +353-21-313603    |
>| Cork City, Ireland.                   Mobile: +353-87-573121    |
>+-----------------------------------------------------------------+

Jerry Helms
Intelligent Information Systems



Sat, 05 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm

Quote:

> Hi all,

> I wish to send the Ctrl-Z and Ctrl-E keys to the Comm port.  Something
> like this

>      MSComm1.output = "^Z"
> or
>      MSComm1.output = "{CTRL}Z"

> But I can't get any of them working.  Anybody got any ideas?

Ctrl-Z is chr$(26) and Ctrl-E is chr$(5). Try this:

   MSComm1.output = chr$(26)
or
   MSComm1.output = chr$(5)

See your ASCII chart for other control code values.

--
===========================================================================
Philippe D. Nave, Jr. | We're sorry - all our .sigs are busy right now.
Denver, Colorado USA  | Please re-read this message, and the next available



Sat, 05 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm

Quote:

> mscomm1.output = chr(13)

Chr$(13) is a Ctrl-M (a carriage return.) Take it from an old bit-basher.

--
===========================================================================
Philippe D. Nave, Jr. | We're sorry - all our .sigs are busy right now.
Denver, Colorado USA  | Please re-read this message, and the next available



Sat, 05 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm

Quote:

> mscomm1.output = chr(13)

> >Hi all,
> >I wish to send the Ctrl-Z and Ctrl-E keys to the Comm port.  Something
> >like this
> >     MSComm1.output = "^Z"
> >or
> >     MSComm1.output = "{CTRL}Z"

[snip]

No, Chr$(13) is control-M. ^Z is Chr$(26), ^E is Chr$(5).

In general, you can pull up the help topic for the ANSI character
set, find the letter you want the control code for in the third
or fourth column, and locate the number in the far left column on
the same row. Alternatively, do this in a Debug window:

? Asc("E") And 31, Asc("Z") And 31
 5             26

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Sat, 05 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm


Quote:

>P.S.  What is the best way of storing passwords?  If I write them
>      to a file as text, anybody and everyone will be able to read
>      them.  I want to be able to read them back as well.
>      Any ideas?

>----------------------------+

The best way would be to encrypt them before writing them out to a file.  I
don't have an encryption routine that I can give you, but you will have to
choose one based on the security level you want.  There are a lot of routines
available.  The simplest would probably be to choose some string of characters
that appears in your code and use it as a key to encrypt and decrypt the pass
words.  That isn't very secure, but it would at least keep somebody from
getting it by just looking at your INI file with a text editor.  Other wise
check and see if you can find a shareware encryption routine.

Good luck,

Bill Gill



Sun, 06 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm



Quote:

>Hi all,

>I wish to send the Ctrl-Z and Ctrl-E keys to the Comm port.  Something
>like this

>     MSComm1.output = "^Z"
>or
>     MSComm1.output = "{CTRL}Z"

>But I can't get any of them working.  Anybody got any ideas?

>Thanks for the help,
>Jim

>P.S.  What is the best way of storing passwords?  If I write them
>      to a file as text, anybody and everyone will be able to read
>      them.  I want to be able to read them back as well.
>      Any ideas?

>+-----------------------------------------------------------------+
>| Jim Barrett,                          Title:  Software Engineer |

>| Neptune House,                        Phone:  +353-21-317001    |
>| Victoria Road,                        Fax:    +353-21-313603    |
>| Cork City, Ireland.                   Mobile: +353-87-573121    |
>+-----------------------------------------------------------------+

For the password solution:

I used an access database which I protected with Tools/Set Database Password.

In this database I have a table which stores the passwords.

In VB used Opendatabase("DatabaseName",False,False,";PWD=PassWord") to open
the database using the password set in Access. This way the only one able to
see the passwords is the one who developes the code. (because he knows the
password)

Robert van Hoornaar



Mon, 07 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm

Quote:

> For the password solution:

> I used an access database which I protected with Tools/Set Database Password.

> In this database I have a table which stores the passwords.

> In VB used Opendatabase("DatabaseName",False,False,";PWD=PassWord") to open
> the database using the password set in Access. This way the only one able to
> see the passwords is the one who developes the code. (because he knows the
> password)

   You also need to make sure that the database isn't owned by the Admin
user inside Access, because if anyone else who has Access and doesn't
use any type of user login system opens Access they are "logged in" as
Admin - thus giving them permissions to open the database without
knowing the password.
   The easiest way I've found to do that is to create your database as
the Admin user, then log in as someone else, create a new database as
that user and then transfer all tables, queries, etc. to the new
database.
   Kinda confusing, but it works.


Mon, 07 Dec 1998 03:00:00 GMT  
 Send Ctrl-Z to Com Port using MSComm

Quote:

>Path: lantana.singnet.com.sg!news-w.ans.net!newsfeeds.ans.net!news.lava.net!news.reed.edu!usenet.ee.pdx.edu!cs.uoregon.edu!sgigate.sgi.com!mr.net!news2.cais.net!news.cais.net!nntp.primenet.com!news.mathworks.com!newsfeed.internetmci.com!news.uoregon.edu!
>ews.HomeNet.ie!news

>Newsgroups: comp.lang.basic.visual.3rdparty,comp.lang.basic.visual,comp.lang.basic.visual.misc,comp.lang.basic.visual.database
>Subject: Send Ctrl-Z to Com Port using MSComm
>Date: 18 Jun 1996 15:03:39 GMT
>Organization: Satcom Ltd.
>Lines: 30

>NNTP-Posting-Host: dialup4.cork.homenet.ie
>Mime-Version: 1.0
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
>Xref: lantana.singnet.com.sg comp.lang.basic.visual.3rdparty:8734 comp.lang.basic.visual.misc:53325 comp.lang.basic.visual.database:13392
>Hi all,
>I wish to send the Ctrl-Z and Ctrl-E keys to the Comm port.  Something
>like this
>     MSComm1.output = "^Z"
>or
>     MSComm1.output = "{CTRL}Z"
>But I can't get any of them working.  Anybody got any ideas?
>Thanks for the help,
>Jim

Try this:

For Control Z:  mscomm1.output = chr(26)
For Control E:  mscomm1.output = chr(5)

26 is the ascii code for Ctr-Z, 5 is the ascii code for Ctr-E. Some
programming book (especially those relating to modem programming) contain a
table of the ascii code of all the control code. Try to get hold of one copy
of it.

Regards.
Ho



Tue, 08 Dec 1998 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Send Ctrl-Z to Com Port using MSComm

2. QUESTION - Sending data out COM port (w/o using MSCOMM.VBX)

3. sending CTRL+Z to the COM port!!?

4. MSComm control - binary data transfer using a com port

5. VB4.0 sending commands to rs232 (com port) and printer port

6. Sending CTRL+Chr to MSCOMM

7. sending ctrl + d through mscomm

8. Sending ctrl-Z to MSComm control?

9. How to send a ctrl-A to MSCOMM

10. Sending CTRL key to a comm port?!

11. sending Ctrl+A keystroke to COM1 port

12. Sending Ctrl-Break to Serial port

 

 
Powered by phpBB® Forum Software