Home > Software engineering >  Vb loop structure
Vb loop structure

Time:09-15

How to do screening text1 text box input alphabetic characters, and the sequence in the text 2 store?

CodePudding user response:

 
Dim As Long I
Dim STRTMP As String
For I=1 To Len (Text1. Text)
If Mid (Text1. Text, I, 1) & gt; "A" Then "the filter condition yourself to write
STRTMP=Mid (Text1. The Text, I, 1) & amp; STRTMP 'antitone
End the If
Next
Text2. Text=STRTMP

CodePudding user response:

In addition to the normal comparison, also can use regular expressions:
 
Dim reg
The set reg=createobject (" vbscript. Regexp ")
Reg. Global=true
Reg. The ignorecase=true
Reg. Multiline=false
Reg. The pattern="[a zA - Z]"

Dim colMatches
The set colMatches=reg. The execute (Text1)

Dim strTemp
StrTemp=""

Dim objMatch
For each objMatch colMatches in
StrTemp=objMatch. Value & amp; StrTemp
Next

Text2 strTemp=
  • Related