473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Basic Instr question

I'm trying to get the "string" results of anything
before "IEA*" in my incoming text file. However the
instr returns the integer (char number 4968) verses the
string itself.

Any suggestions would be most appreciated.

i = InStr(strinfile, "IEA*") 'returns 4968 vs long string

Cheers,
Mike
Jul 21 '05 #1
3 1382
Mike Anderson <an******@yahoo.com> wrote:
I'm trying to get the "string" results of anything
before "IEA*" in my incoming text file. However the
instr returns the integer (char number 4968) verses the
string itself.

Any suggestions would be most appreciated.

i = InStr(strinfile, "IEA*") 'returns 4968 vs long string


Use String.Substring to retrieve the string itself.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
Thank you
-----Original Message-----
Mike Anderson <an******@yahoo.com> wrote:
I'm trying to get the "string" results of anything
before "IEA*" in my incoming text file. However the
instr returns the integer (char number 4968) verses the string itself.

Any suggestions would be most appreciated.

i = InStr(strinfile, "IEA*") 'returns 4968 vs long
string
Use String.Substring to retrieve the string itself.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.

Jul 21 '05 #3
i = left(strinfile,InStr(strinfile, "IEA*")-4)
"Mike Anderson" <an******@yahoo.com> wrote in message
news:59****************************@phx.gbl...
I'm trying to get the "string" results of anything
before "IEA*" in my incoming text file. However the
instr returns the integer (char number 4968) verses the
string itself.

Any suggestions would be most appreciated.

i = InStr(strinfile, "IEA*") 'returns 4968 vs long string

Cheers,
Mike

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: DTB | last post by:
I am trying to convert a complex function from Oracle to SQL Server and have come across Oracle's Instr() function. I see SQL Server has CHARINDEX() which is similar, however it does not provide...
14
by: deko | last post by:
For some reason this does not seem to be working... Am I missing something basic? Dim rst As DAO.Recordset Dim db As DAO.Database Set db = CurrentDb Set rst = db.OpenRecordset("qryEmailS") '...
6
by: Chris Calzaretta | last post by:
Hello Everybody, Question instr function will give you the first instance of the finding so EX: so your string looks like string1 = "testing>This is > just a test > testtesttest"...
3
by: Mike Anderson | last post by:
I'm trying to get the "string" results of anything before "IEA*" in my incoming text file. However the instr returns the integer (char number 4968) verses the string itself. Any suggestions...
27
by: code_wrong | last post by:
Visual Basic (not dot net) what is the best way to check the User has entered an integer into an InputBox? isNumeric() checks for a numeric value .. but does not notify of numbers with decimal...
12
by: rodchar | last post by:
hey all, i'm getting a result that i don't understand i have a string "test1, test2" If InStr("test1") and InStr("test2") Then 'Inside EndIf The inside is not running for some reason. Any...
2
by: evolutionevolve07 | last post by:
my teacher have gave me an assignment about searching. and i have find a way on it already but now he wants me to use instr. now the question is i dont know how to do it, is anyone here can help me...
0
by: veer | last post by:
Hi can any one help me by providing the method how i read the text from html file. i did it by this method Open newstr For Input As #1 While Not EOF(1) ...
3
by: Alex Pavluck | last post by:
I have a date stored like this '2004 - 2006' and I use this code to get startyear and stopyear StartYear: Trim(Left(,InStr(,"-")-1)) StopYear: Trim(Right(,InStr(,"-")-1)) Is there a way to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.