Solved

instr

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

777 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