Solved

instr

Posted on 1998-10-07
3
360 Views
Last Modified: 2010-04-30
are there any problems in writing var1=instr(temp,".")-1
where temp is b.0, and var1 is a string. will var1 get the value 1 or 0. what happends if there is no "." in temp?
what will be the value of mid$(temp,1,instr(temp,".")-1) , is it b. thank you.
0
Comment
Question by:ilanm
  • 2
3 Comments
 

Author Comment

by:ilanm
ID: 1438686
Edited text of question
0
 
LVL 3

Accepted Solution

by:
vmano earned 30 total points
ID: 1438687
the instr syntax is:
instr( start, string1, string2, compare)
string1 is your temp
string2 is the required string.

and more to follow...
0
 
LVL 3

Expert Comment

by:vmano
ID: 1438688
if you do var1 = instr(1,temp, ".") -1, var1 will return 1
and if there is no "." in temp, var1 will return -1
and if you do  var1 = Mid$(temp, 1, (InStr(1, temp, ".") - 1)), var1 will return "b"

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now