Solved

instr

Posted on 1998-10-07
3
357 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

13 Experts available now in Live!

Get 1:1 Help Now