I need to find the existence of two dollar signs in a string. I tried
the InStr command but could not make it work:

barcode = "whatever$$asdfa"
twodollarsigns = "$$"
If InStr(barcode,twodollarsigns)=0 Then
MsgBox "there is missing data"

It works with other characters, not the $$. Any ideas on how I can do
this?

Thanks

DG

Re: Using InStr to find $$ by Michael

Michael
Sun Feb 25 19:54:29 CST 2007

DorkyGrin wrote:
> I need to find the existence of two dollar signs in a string. I tried
> the InStr command but could not make it work:
>
> barcode = "whatever$$asdfa"
> twodollarsigns = "$$"
> If InStr(barcode,twodollarsigns)=0 Then
> MsgBox "there is missing data"
>
> It works with other characters, not the $$. Any ideas on how I can do
> this?

??? it works for me...

barcode = "whatever$$asdfa"
twodollarsigns = "$$"
If InStr(barcode,twodollarsigns)=0 Then
MsgBox "there is missing data"
Else
MsgBox "found $$ at " & InStr(barcode,twodollarsigns)
End If

--
Michael Harris
Microsoft.MVP.Scripting



Re: Using InStr to find $$ by DorkyGrin

DorkyGrin
Sun Feb 25 20:20:53 CST 2007

I don't know why I couldn't get it to work. I ended up using this:

barcode = "wh$$ateverasdfa"
twodollarsigns = "$$"
If InStr(barcode,twodollarsigns)<>0 Then
MsgBox "there is missing data"
End If
MsgBox "no missing data"

Thanks Michael for checking it.

DG




On Feb 25, 8:54 pm, "Michael Harris \(MVP\)" <mikhar.at.mvps.dot.org>
wrote:
> DorkyGrin wrote:
> > I need to find the existence of two dollar signs in a string. I tried
> > the InStr command but could not make it work:
>
> > barcode = "whatever$$asdfa"
> > twodollarsigns = "$$"
> > If InStr(barcode,twodollarsigns)=0 Then
> > MsgBox "there is missing data"
>
> > It works with other characters, not the $$. Any ideas on how I can do
> > this?
>
> ??? it works for me...
>
> barcode = "whatever$$asdfa"
> twodollarsigns = "$$"
> If InStr(barcode,twodollarsigns)=0 Then
> MsgBox "there is missing data"
> Else
> MsgBox "found $$ at " & InStr(barcode,twodollarsigns)
> End If
>
> --
> Michael Harris
> Microsoft.MVP.Scripting



Re: Using InStr to find $$ by Ayush

Ayush
Sun Feb 25 20:38:03 CST 2007

Replied to [DorkyGrin]s message :
> I don't know why I couldn't get it to work. I ended up using this:

> barcode = "wh$$ateverasdfa"
> twodollarsigns = "$$"
> If InStr(barcode,twodollarsigns)<>0 Then
> MsgBox "there is missing data"
> End If
> MsgBox "no missing data"

> Thanks Michael for checking it.

Strange.What do you get by this :

barcode = "whatever$$asdfa"
twodollarsigns = "$$"
msgbox InStr(barcode,twodollarsigns)


Good Luck, Ayush.
--
VBScript, JScript, WSH Reference : http://www.devguru.com/

Re: Using InStr to find $$ by DorkyGrin

DorkyGrin
Sun Feb 25 20:50:44 CST 2007

I get "9"




>
> Strange.What do you get by this :
>
> barcode = "whatever$$asdfa"
> twodollarsigns = "$$"
> msgbox InStr(barcode,twodollarsigns)
>
> Good Luck, Ayush.
> --
> VBScript, JScript, WSH Reference :http://www.devguru.com/



Re: Using InStr to find $$ by Michael

Michael
Sun Feb 25 20:47:05 CST 2007

DorkyGrin wrote:
> I don't know why I couldn't get it to work. I ended up using this:
>

Which doesn't look at all right to me...

> barcode = "wh$$ateverasdfa"
> twodollarsigns = "$$"
> If InStr(barcode,twodollarsigns)<>0 Then
> MsgBox "there is missing data"
> End If
> MsgBox "no missing data"
>
> Thanks Michael for checking it.
>
> DG
>
>
>
>
> On Feb 25, 8:54 pm, "Michael Harris \(MVP\)" <mikhar.at.mvps.dot.org>
> wrote:
>> DorkyGrin wrote:
>>> I need to find the existence of two dollar signs in a string. I
>>> tried the InStr command but could not make it work:
>>
>>> barcode = "whatever$$asdfa"
>>> twodollarsigns = "$$"
>>> If InStr(barcode,twodollarsigns)=0 Then
>>> MsgBox "there is missing data"
>>
>>> It works with other characters, not the $$. Any ideas on how I can
>>> do this?
>>
>> ??? it works for me...
>>
>> barcode = "whatever$$asdfa"
>> twodollarsigns = "$$"
>> If InStr(barcode,twodollarsigns)=0 Then
>> MsgBox "there is missing data"
>> Else
>> MsgBox "found $$ at " & InStr(barcode,twodollarsigns)
>> End If
>>
>> --
>> Michael Harris
>> Microsoft.MVP.Scripting

--
Michael Harris
Microsoft.MVP.Scripting



Re: Using InStr to find $$ by DorkyGrin

DorkyGrin
Sun Feb 25 20:59:38 CST 2007

It seems to work fine -- if InStr finds $$, it returns a number
indicating it's position in the string. So, returning any number that
is not zero would make it true and display the message.

Is this bad logic?



>
> Which doesn't look at all right to me...
>
>
>
> > barcode = "wh$$ateverasdfa"
> > twodollarsigns = "$$"
> > If InStr(barcode,twodollarsigns)<>0 Then
> > MsgBox "there is missing data"
> > End If
> > MsgBox "no missing data"
>
> > Thanks Michael for checking it.
>
> > DG
>
> > On Feb 25, 8:54 pm, "Michael Harris \(MVP\)" <mikhar.at.mvps.dot.org>
> > wrote:
> >> DorkyGrin wrote:
> >>> I need to find the existence of two dollar signs in a string. I
> >>> tried the InStr command but could not make it work:
>
> >>> barcode = "whatever$$asdfa"
> >>> twodollarsigns = "$$"
> >>> If InStr(barcode,twodollarsigns)=0 Then
> >>> MsgBox "there is missing data"
>
> >>> It works with other characters, not the $$. Any ideas on how I can
> >>> do this?
>
> >> ??? it works for me...
>
> >> barcode = "whatever$$asdfa"
> >> twodollarsigns = "$$"
> >> If InStr(barcode,twodollarsigns)=0 Then
> >> MsgBox "there is missing data"
> >> Else
> >> MsgBox "found $$ at " & InStr(barcode,twodollarsigns)
> >> End If
>
> >> --
> >> Michael Harris
> >> Microsoft.MVP.Scripting
>
> --
> Michael Harris
> Microsoft.MVP.Scripting



Re: Using InStr to find $$ by Ayush

Ayush
Sun Feb 25 21:01:10 CST 2007

Replied to [DorkyGrin]s message :
> I get "9"
'

Then this should work :

barcode = "whatever$$asdfa"
twodollarsigns = "$$"
If Not InStr(barcode,twodollarsigns) Then
MsgBox "there is missing data"
End If

Good Luck, Ayush.
--
VBScript, JScript, WSH Reference : http://www.devguru.com/

Re: Using InStr to find $$ by DorkyGrin

DorkyGrin
Sun Feb 25 21:30:33 CST 2007

Ok, thanks




> Then this should work :
>
> barcode = "whatever$$asdfa"
> twodollarsigns = "$$"
> If Not InStr(barcode,twodollarsigns) Then
> MsgBox "there is missing data"
> End If
>
> Good Luck, Ayush.
> --
> VBScript, JScript, WSH Reference :http://www.devguru.com/



Re: Using InStr to find $$ by Ayush

Ayush
Sun Feb 25 21:31:26 CST 2007

Replied to [DorkyGrin]s message :
> Ok, thanks


You r welcome.

Good Luck, Ayush.
--
Regular Expression Syntax : http://snipurl.com/RegularExpr_Syntax

Re: Using InStr to find $$ by McKirahan

McKirahan
Sun Feb 25 21:41:23 CST 2007

"DorkyGrin" <DorkyGrin@yahoo.com> wrote in message
news:1172458778.031564.260120@h3g2000cwc.googlegroups.com...
> It seems to work fine -- if InStr finds $$, it returns a number
> indicating it's position in the string. So, returning any number that
> is not zero would make it true and display the message.
>
> Is this bad logic?
>
>
>
> >
> > Which doesn't look at all right to me...
> >
> >
> >
> > > barcode = "wh$$ateverasdfa"
> > > twodollarsigns = "$$"
> > > If InStr(barcode,twodollarsigns)<>0 Then
> > > MsgBox "there is missing data"
> > > End If
> > > MsgBox "no missing data"

Originally you had:

If InStr(barcode,twodollarsigns)=0 Then
MsgBox "there is missing data"

So "there is missing data" if it's 0 and not 0?



Re: Using InStr to find $$ by DorkyGrin

DorkyGrin
Mon Feb 26 06:53:08 CST 2007

There is missing data if "$$" is found anywhere in the string.

>
> > > > barcode = "wh$$ateverasdfa"
> > > > twodollarsigns = "$$"
> > > > If InStr(barcode,twodollarsigns)<>0 Then
> > > > MsgBox "there is missing data"
> > > > End If
> > > > MsgBox "no missing data"
>
> Originally you had:
>
> If InStr(barcode,twodollarsigns)=0 Then
> MsgBox "there is missing data"
>
> So "there is missing data" if it's 0 and not 0?