Normal Topic @FindStringArray (Read 1340 times)
pineberry
Full Member
***
Offline


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
@FindStringArray
Dec 20th, 2014 at 11:05pm
Print Post Print Post  
I have a problem getting the position of a - in the following statement.
I always get a return code of -1 when trying various approaches.

Dash = @findStringArray(vChoice,"-")
where vChoice has been defined as string.
I have tried putting vChoice in quotes, the - as  " - " since it is preceded and followed by a space.
Also I have tried defining Dash as both integer and string.
I also tried a character other than - that I knew was present in the string.
My goal is to determine the length of the string and then extract all characters after the - using@Right.

What am I missing?

Harley
  
Back to top
 
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: @FindStringArray
Reply #1 - Dec 21st, 2014 at 7:32pm
Print Post Print Post  
Hello Harley,

Is vChoice a StringArray(a list of separated values) or just data in a field?

If it's the later, could you be looking for something like this:

Dash = @Mid(vChoice, @Instr(vChoice, "-") + 1, 500)

Brandon
  
Back to top
IP Logged
 
pineberry
Full Member
***
Offline


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
Re: @FindStringArray
Reply #2 - Dec 22nd, 2014 at 3:19am
Print Post Print Post  
vChoice is a  string such as
UPS - 12345
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @FindStringArray
Reply #3 - Dec 22nd, 2014 at 2:06pm
Print Post Print Post  
Pineberry,

You will want to use the @instr function, rather than any of the string array functions.

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
pineberry
Full Member
***
Offline


No personal text

Posts: 115
Location: Strawberry, AZ  USA
Joined: Nov 30th, 2002
Re: @FindStringArray
Reply #4 - Dec 22nd, 2014 at 3:54pm
Print Post Print Post  
Thanks,
I'll try that later today.
  
Back to top
 
IP Logged