Click to See Complete Forum and Search --> : String Arrays
RSH
June 17th, 2001, 08:59 AM
I have 16 strings eminating from 16 buttons corresponding to DTMF keypad buttons.These should be entered into one long string in whatever sequence the buttons were pushed. Sounds like a string array to me but for some reason the confuser doesnt like what I am trying. Any Good words out there?
73 RSH
Cimperiali
June 18th, 2001, 05:41 AM
If you can code in keypress event (or keyup) why not simply do:
'set form keypreview to true
Dim strTheTring
private Sub Form_KeyPress(KeyAscii as Integer)
strTheTring = strTheTring & Chr$(KeyAscii)
End Sub
and provide a way to clear strTheTring on request
(ie: pressing Del key?)
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
Cimperiali
June 18th, 2001, 05:47 AM
Whoops...Did not read your question well... However, you can manage with 16 strings and keypress event:
Dim firstString as string
Dim secondString as string
...
or:
const firstString = "blabla" as string
....
and:
'set form keypreview to true
Dim strTheTotal
private Sub Form_KeyPress(KeyAscii as Integer)
select case keyascii
case 0
strTheTotal = strTheTotal & firstString
case 1
strTheTotal = strTheTotal & secondString
case 2
....
case else
.....
end select
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
RSH
June 19th, 2001, 08:31 AM
Cimperiali:
You are right. This can be done without a string array. Your suggestion got me going on a solution (Probably one of many). Each pushbutton generates a character which is sent to 20 lines of strings, and if the string is empty then it assigns a value. That way whatever button is pressed first goes into the first string etc. Then add the strings as they are done and comes out the total number including non numerical characters. A Bit wordy but it works. Probably not a real guru's way.
73 RSH
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.