I think this might work
myString = "Value 1 is:" & vbTab & textBox1
make sure that multiline is set to true in any text box that uses that string.
It also depends on what is desired. The replace function, which wasn't in my original code as it wasn't needed, only takes out spaces. If there are any numbers present they may mess things up with the i as well. but if they are allowed it should work perfectly with only slight modification of...
I'd be carefull using the i to indicate odd letters. The i is going through the whole message which means counting spaces as well which might make the algorithum hickup.
ex. "to do right" -> torgt -> "some numbers" instead of the expected tdrgt -> "some numbers"
Spaces are automatically ignored in this code so all that is needed is a boolean to tell it whether to add a number or skip adding until the next.
Dim addNum as Boolean
Private Sub Command1_Click()
Dim som As Integer
Dim compile, temp As String
Text1.Text = Replace(Text1.Text, " "...
ok this might be a little messy but it will do what I think you are asking for
Private Sub Command1_Click()
'holds the integer value of the character
Dim som As Integer
'holds the number values as they are being brought together
Dim compile As String
'holds the string taken from the text box...
Are you trying to replace all letters with numbers? If so are "a" and "A" counted the same or differently. What numbers do you want to assigen to what letters besides "a" to 1?
It depends on when you want it replaced. Do you want the letter replace as its being typed or when some other action occurs? Just a single occurance, if it was always in upper case, could be done with asc(letter)-64. this will give a listing bettween 1-26 for A-Z.
If I remeber correctly you can simply set a char value equel to the number:
char break = 27;
It should also works the other way around so that
int c = 'c';
will show the ascii value for c
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.