[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

John Simpson

8/31/2010 5:51:00 PM

Help!!!

Windows 7, VB6

I have the following code with a mysterious problem. Hitting
keys A thru Z or numbers 0 thru 9, assign the correct results
the variable ch below. Punctuation is wrong. For example, the
/ key returns a keycode of 191.

I'm sure there is a simple fix, but it eludes me!

'
'
'
Private Sub rtbDesc_KeyDown(KeyCode As Integer, Shift As Integer)
Static keyStroke As Long
Dim sp As Long
Dim ch As String * 1

If KeyCode <> 8 Then ' don't count the BS
keyStroke = keyStroke + 1 ' count keystrokes
Else ' if it is a BS then
keyStroke = keyStroke - 1 ' decrement the count
End If

If keyStroke > 60 And KeyCode = 32 Then ' if more than 60
rtbDesc.text = rtbDesc.text & vbCrLf ' characters and a space
sp = Len(rtbDesc.text) ' append a crlf to the
rtbDesc.SelStart = sp ' text string and
lineLength = sp
keyStroke = 0 '
End If '

If KeyCode = 10 Or KeyCode = 13 Then
keyStroke = 0
lineLength = 0
tmptext = ""
Else
lineLength = lineLength + 1
ch = Chr$(KeyCode)
tmptext = tmptext & ch
End If

Text1.text = KeyCode & " " & Str(lineLength) & " " & tmptext

If Len(tmptext) < 30 Then
flxDesc.Clear
DoEvents
DisplayText tmptext, Len(tmptext)
End If

End Sub

Thanks is advance.

John
11 Answers

pjmcder

1/30/2009 10:20:00 PM

0

On Jan 30, 4:58 pm, Jack <cre...@aol.com> wrote:
> On Jan 30, 12:13 pm, pjmcder <sca...@hotmail.com> wrote:
>
> > On Jan 30, 2:13 pm, "Harry Bournazian" <rox...@verizon.net> wrote:
>
> > > Greetings from Tampa..Ya'll
> > > We are working the half time show for Springsteen !!! Setting up and
> > > breaking down the stage. We have been here since Tuesday getting ready and
> > > we had a full dressed run through last night. Full half time show for about
> > > 300 of us.
>
> > > 10th Ave
> > > BTR
> > > Workin on a dream (Wait till you hear his back up singers)
> > > Glory Days
>
> > If this is true......kudos to me for calling this list!!!! whoo-hoo
>
> Me too! But in a different order, I guess....

actually I had BTR third, followed by GD

Jack

1/30/2009 10:23:00 PM

0

On Jan 30, 2:20 pm, pjmcder <sca...@hotmail.com> wrote:
> On Jan 30, 4:58 pm, Jack <cre...@aol.com> wrote:
>
>
>
> > On Jan 30, 12:13 pm, pjmcder <sca...@hotmail.com> wrote:
>
> > > On Jan 30, 2:13 pm, "Harry Bournazian" <rox...@verizon.net> wrote:
>
> > > > Greetings from Tampa..Ya'll
> > > > We are working the half time show for Springsteen !!! Setting up and
> > > > breaking down the stage. We have been here since Tuesday getting ready and
> > > > we had a full dressed run through last night. Full half time show for about
> > > > 300 of us.
>
> > > > 10th Ave
> > > > BTR
> > > > Workin on a dream (Wait till you hear his back up singers)
> > > > Glory Days
>
> > > If this is true......kudos to me for calling this list!!!!  whoo-hoo
>
> > Me too!  But in a different order, I guess....
>
> actually I had BTR third, followed by GD

Don't remember, But I think I had, 10th, WOAD, GD, BTR. Do we come
down to the tiebreaker?

pjmcder

1/30/2009 11:12:00 PM

0

On Jan 30, 5:22 pm, Jack <cre...@aol.com> wrote:
> On Jan 30, 2:20 pm, pjmcder <sca...@hotmail.com> wrote:
>
>
>
> > On Jan 30, 4:58 pm, Jack <cre...@aol.com> wrote:
>
> > > On Jan 30, 12:13 pm, pjmcder <sca...@hotmail.com> wrote:
>
> > > > On Jan 30, 2:13 pm, "Harry Bournazian" <rox...@verizon.net> wrote:
>
> > > > > Greetings from Tampa..Ya'll
> > > > > We are working the half time show for Springsteen !!! Setting up and
> > > > > breaking down the stage. We have been here since Tuesday getting ready and
> > > > > we had a full dressed run through last night. Full half time show for about
> > > > > 300 of us.
>
> > > > > 10th Ave
> > > > > BTR
> > > > > Workin on a dream (Wait till you hear his back up singers)
> > > > > Glory Days
>
> > > > If this is true......kudos to me for calling this list!!!! whoo-hoo
>
> > > Me too! But in a different order, I guess....
>
> > actually I had BTR third, followed by GD
>
> Don't remember, But I think I had, 10th, WOAD, GD, BTR. Do we come
> down to the tiebreaker?

several people here were pulling for 10th and several were dismissive
that he would play it......but it is two days away and Bruce has been
known to change his mind.

Donnieb78

1/30/2009 11:30:00 PM

0

Like he says, Bruce is the Decider, and I don't think any list is
final until Bruce hits the stage.
If he decides Sunday night that he wants to play "Midnight Hour," the
band could do it.

EmmaPeachbuns

1/30/2009 11:55:00 PM

0

On Jan 30, 6:29 pm, Donnieb78 <donnie...@hotmail.com> wrote:
> Like he says, Bruce is the Decider, and I don't think any list is
> final until Bruce hits the stage.
> If he decides Sunday night that he wants to play "Midnight Hour," the
> band could do it.

WRONG

Heywood Jablome

1/31/2009 12:02:00 AM

0

On Jan 30, 6:12 pm, pjmcder <sca...@hotmail.com> wrote:
> On Jan 30, 5:22 pm, Jack <cre...@aol.com> wrote:
>
>
>
>
>
> > On Jan 30, 2:20 pm, pjmcder <sca...@hotmail.com> wrote:
>
> > > On Jan 30, 4:58 pm, Jack <cre...@aol.com> wrote:
>
> > > > On Jan 30, 12:13 pm, pjmcder <sca...@hotmail.com> wrote:
>
> > > > > On Jan 30, 2:13 pm, "Harry Bournazian" <rox...@verizon.net> wrote:
>
> > > > > > Greetings from Tampa..Ya'll
> > > > > > We are working the half time show for Springsteen !!! Setting up and
> > > > > > breaking down the stage. We have been here since Tuesday getting ready and
> > > > > > we had a full dressed run through last night. Full half time show for about
> > > > > > 300 of us.
>
> > > > > > 10th Ave
> > > > > > BTR
> > > > > > Workin on a dream (Wait till you hear his back up singers)
> > > > > > Glory Days
>
> > > > > If this is true......kudos to me for calling this list!!!!  whoo-hoo
>
> > > > Me too!  But in a different order, I guess....
>
> > > actually I had BTR third, followed by GD
>
> > Don't remember, But I think I had, 10th, WOAD, GD, BTR.  Do we come
> > down to the tiebreaker?
>
> several people here were pulling for 10th and several were dismissive
> that he would play it......but it is two days away and Bruce has been
> known to change his mind.- Hide quoted text -
>
> - Show quoted text -


If 10th was rehearsed, and the horns are there, id say its a 100% lock

Rave On!

1/31/2009 12:53:00 AM

0

While the band plays "live" at the venue, isn't it a prerecorded track
that plays on the television broadcast? If so, then once the
recording is made, the set would be set in stone.

Rave On!
Scott
--Hoping Steve Doesn't Have a Wardrobe Malfunction, NJ--

Jeff Johnson [MVP: VB]

8/31/2010 6:01:00 PM

0

"John Simpson" <jasimp.nospam@earthlink.net> wrote in message
news:i5jfe7$5lt$1@news.eternal-september.org...

> Windows 7, VB6
>
> I have the following code with a mysterious problem. Hitting
> keys A thru Z or numbers 0 thru 9, assign the correct results
> the variable ch below. Punctuation is wrong. For example, the
> / key returns a keycode of 191.
>
> I'm sure there is a simple fix, but it eludes me!

There is a big difference between KeyCode (the parameter to KeyDown/Up) and
KeyAscii (the parameter to KeyPress). There are all sorts of keycodes
assigned to different keys on your keyboard. The / down by the shift key has
a different code than the / on the numeric keypad, because they are two
physically different keys. You can't count on a keycode paralleling the
ASCII code for the character on the key; the ASCII code is retrieved from a
map.

This has nothing to do with Windows 7, by the way, and should happen on any
OS.

Check out the vbKey* constants. You can find them via Intellisense or in the
Object Browser in the <globals> section of the VBRUN library.


John Simpson

8/31/2010 6:24:00 PM

0

"Jeff Johnson" <i.get@enough.spam> wrote in
news:i5jg0u$b85$1@news.eternal-september.org:

> "John Simpson" <jasimp.nospam@earthlink.net> wrote in message
> news:i5jfe7$5lt$1@news.eternal-september.org...
>
>> Windows 7, VB6
>>
>> I have the following code with a mysterious problem. Hitting
>> keys A thru Z or numbers 0 thru 9, assign the correct results
>> the variable ch below. Punctuation is wrong. For example, the
>> / key returns a keycode of 191.
>>
>> I'm sure there is a simple fix, but it eludes me!
>
> There is a big difference between KeyCode (the parameter to
> KeyDown/Up) and KeyAscii (the parameter to KeyPress). There are all
> sorts of keycodes assigned to different keys on your keyboard. The /
> down by the shift key has a different code than the / on the numeric
> keypad, because they are two physically different keys. You can't
> count on a keycode paralleling the ASCII code for the character on the
> key; the ASCII code is retrieved from a map.
>
> This has nothing to do with Windows 7, by the way, and should happen
> on any OS.
>
> Check out the vbKey* constants. You can find them via Intellisense or
> in the Object Browser in the <globals> section of the VBRUN library.
>
>
>

Jeff,

I'm aware of all of the above, but how do I resolve this problem???

I mentioned Windows 7, because I always try to define the environment
before I post the question.

Thanks.

John

ralph

8/31/2010 7:33:00 PM

0

On Tue, 31 Aug 2010 18:24:10 +0000 (UTC), John Simpson
<jasimp.nospam@earthlink.net> wrote:


>
>I'm aware of all of the above, but how do I resolve this problem???
>
>I mentioned Windows 7, because I always try to define the environment
>before I post the question.
>

Perhaps KeyPress() would be more useful?

Note: You are usually better off to do any processing in a "Key Up" or
"Key Press" and use "Key Down" to set flags for combinations, ie,
Ctrl+A, Shift+Tab, ...

But that is just general advise and can be safely ignored. <g>

-ralph