VB Script Help please?
|
|||
|
Rank: ? (1224)
Member #: 15685 |
Does anyone know of a function in vbscript dat will allow me to do this...for example i have a variable dat keeps an array
variable1="1,2,3,4,5" and another variable with this: match="1,2,3" so the function would be like this flow below: if "1,2,3" in match is found in variable1 then erase "1,2,3" from variable1 end if thanks
Stick and Stones may break my bones but Caricatures will cause a riot!
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
maybe a replace?
variable1 = Replace(variable1, match, "" with your example values, that would set variable1 to ",4,5" -- probably not exactly what you're looking for then.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (1224)
Member #: 15685 |
hmmmm the comma would be a problem....but we're heading in the right direction...thx...any more?
Stick and Stones may break my bones but Caricatures will cause a riot!
|
||
|
|||
|
|||
|
Rank: ? (1224)
Member #: 15685 |
hang on...wouldn't dat just replace variable1 with match? then variable1 will be empty
Stick and Stones may break my bones but Caricatures will cause a riot!
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
vb does replace backward from some other replace functions--the first argument is the string to do the replacing on, the second is what to look for, and the third is what to replace it with.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (1224)
Member #: 15685 |
ok wat about lets say i have a var1="7,87,1,2,3,4,5,78,8"
now i just want to take out dat "7," and dat ",8" which is the 1st 2 characters and the last 2 characters... if i use replace(var1,(left(var1,2),"" THANKS
Stick and Stones may break my bones but Caricatures will cause a riot!
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
if you know you want to get rid of the ends, you can use Left() and Right(). the following gets rid of the 1st two and last 2 characters:
var1 = Left(var1, Len(var1)-2) 'remove last two chars var1 = Right(var1, Len(var1)-2) 'remove first two chars you could also do this with a single call to Mid(), but i don't remember exactly how that works.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (1)
Member #: 28815 |
Form3.Show Timer1.Interval = 3000 code for form3 is dis: Private Sub Option1_Click() If Option1.Value = True Then Form4.show Form5.Hide End If End Sub Private Sub Option2_Click() If Option2.Value = True Then Form5.show Form4.Hide End If End Sub pls i really nid to pass thgis project on wednesday!!!!!!! |
||
|
Please login or register to post a reply.