Free2Code
 
Time: 2008-11-21, 08:35pm
VB Script Help please?
Subject: VB Script Help please?  ·  Posted: 2005-03-29, 09:33pm
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!
 
  Reply to this ·  Post link ·  Top
Subject: Re: VB Script Help please?  ·  Posted: 2005-03-30, 04:43am
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
 
  Reply to this ·  Post link ·  Top
Subject: Re: VB Script Help please?  ·  Posted: 2005-03-30, 12:24pm
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!
 
  Reply to this ·  Post link ·  Top
Subject: Re: VB Script Help please?  ·  Posted: 2005-03-30, 12:45pm
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!
 
  Reply to this ·  Post link ·  Top
Subject: Re: VB Script Help please?  ·  Posted: 2005-03-30, 05:25pm
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
 
  Reply to this ·  Post link ·  Top
Subject: Re: VB Script Help please?  ·  Posted: 2005-04-06, 03:39pm
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),"" or replace(var1,(right(var1,2),""...it ends up taking out 87 and 78 as well....so how do i just take out the "7," and ",8" without touching anything else?

THANKS



Stick and Stones may break my bones but Caricatures will cause a riot!
 
  Reply to this ·  Post link ·  Top
Subject: Re: VB Script Help please?  ·  Posted: 2005-04-12, 05:54am
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
 
  Reply to this ·  Post link ·  Top
Subject: help me!!!!!!!!!! im bleeding!!!!!!!!!!!  ·  Posted: 2006-10-13, 09:06pm
Rank: ? (1)
Member #: 28815
can u pls help me iis that the form3 is continue to show even though im already on form4 my code for my form2 w\c is a spash screen is lyk dis:
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!!!!!!!

 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons