Re: String Variable containing "R" has zero length??? mscomm1.input
From: Al Reid (areidjr_at_reidDASHhome.com)
Date: 11/02/04
- Next message: mike: "Re: String Variable containing "R" has zero length??? mscomm1.input"
- Previous message: mike: "String Variable containing "R" has zero length??? mscomm1.input"
- In reply to: mike: "String Variable containing "R" has zero length??? mscomm1.input"
- Next in thread: mike: "Re: String Variable containing "R" has zero length??? mscomm1.input"
- Reply: mike: "Re: String Variable containing "R" has zero length??? mscomm1.input"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 08:43:33 -0500
"mike" <spamme0@netscape.net> wrote in message news:41878DE9.4080803@netscape.net...
> String Variable containing "R" has zero length??? mscomm1.input
> I can't read from the serial port.
>
> Visual Basic 6.0 version 8176
> Windows 98SE
>
> Here's the program.
>
> dim c as string
> dim d as integer
> test:
> c = mscomm1.input
> debug.print c, len(c)
> d = asc(c) 'Program stops here error message 5
> goto test
>
> There's more to it, setting up the speed and handshake, opening the port
> etc.
>
> I have the input buffer length set to 1, but doesn't seem to matter.
> I had a test after the read to go to test: if c = "" but that wasn't
> fruitful. Length is zero but it's not null, see below.
>
> I send the string "Ready" into the serial port.
>
> The program aborts on the line indicated error code 5 illegal
> procedure call or argument.
>
> When the program stops in the debugger, you can hover the cursor over
> variables and see their values.
>
> The variable c contains "R" which is correct.
> len(c) is 0 which is NOT correct.
> The debug print statement prints a tab and a zero. No "R", just the
> length of zero.
>
> I've pulled out the last of my hair trying to figure out how to fix this.
> I've tried terminating any processes that might be in contention for the
> serial port, but no help. The first character is being received ok.
> How can a string variable containing "R" have a length of zero???
>
> Suggestions?
>
> Thanks, mike
>
>
> --
> Return address is VALID.
> 500MHz Tek DSOscilloscope TDS540 $2200
> Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121
> Bunch of stuff For Sale and Wanted at the link below.
> http://www.geocities.com/SiliconValley/Monitor/4710/
>
First, it has been ages since I used the Comm Control. However, everything you have stated is consistent with the variable "c"
containing an empty string rather that the character "R".
Debug.Print "", Len("")
Debug.Print Asc("")
gives the same results you stated above.
You need to find out why the com control is returning an empty string.
Hopefully, someone else can help on that.
-- Al Reid How will I know when I get there... If I don't know where I'm going?
- Next message: mike: "Re: String Variable containing "R" has zero length??? mscomm1.input"
- Previous message: mike: "String Variable containing "R" has zero length??? mscomm1.input"
- In reply to: mike: "String Variable containing "R" has zero length??? mscomm1.input"
- Next in thread: mike: "Re: String Variable containing "R" has zero length??? mscomm1.input"
- Reply: mike: "Re: String Variable containing "R" has zero length??? mscomm1.input"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|