• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

Instr problem


Hi Guys

I always had problem with instr


dim mystring as string
mystring="aa bb"

I want to get the in two separate variables aa and bb
basically anything from the start to the space and
anything from the space to the end

dim variableAA as string
variableAA=instr(????)
variableBB=instr(???)

can you help
Thanks
Gabriel
0
Gabriel_Brienza
Asked:
Gabriel_Brienza
  • 5
  • 4
1 Solution
 
WizOfOzCommented:
Why not use split?
variableAA=split (mystring," ")(0)
variableBB=split (mystring," ")(0)
0
 
WizOfOzCommented:
ops, xcuse me
variableBB=split (mystring," ")(1)
0
 
Gabriel_BrienzaAuthor Commented:
Hi there
it says script outof range
Any Ideas
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
WizOfOzCommented:
variableAA=split(mystring, " ")(0)
variableBB=split(mystring, " ")(1)

try this

0
 
Gabriel_BrienzaAuthor Commented:
Another thing,
Variable aa and variablebb can be of any length!
Thanks
Gabriel
0
 
WizOfOzCommented:
xcuse my last post
0
 
Gabriel_BrienzaAuthor Commented:
It works!!
Thanks
Gabriele
0
 
Gabriel_BrienzaAuthor Commented:
Actually it didnt work
Any further suggestions
Thanks
Gabriel
0
 
Gabriel_BrienzaAuthor Commented:
sorry it works actually
APOLOGIES
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now