Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Looking at characters in a string

Posted on 1999-07-28
3
Medium Priority
?
127 Views
Last Modified: 2010-04-30
I am working on a program that reads an .ini file.  My .ini file looks something like this
BitRate=5333333
BandWidth=20
Path=C:\mydirectory\myfile.txt

I know how to read this into a variable, but I don't know how search for specific character.  I want to beable to search for the = sign, and when it comes across the = sign it will then get everything to the right of it.   I hope I explained this right.  I look all through the MSDN and could find anything on this....Thanks  

0
Comment
Question by:strongd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
newcumdb earned 80 total points
ID: 1528008
This might work for you:

  Dim sOriginal As String
  Dim sRightSide As String
  Dim iEqualsPosition As Integer
   
  sOriginal = "BitRate=5333333"
  iEqualsPosition = InStr(sOriginal, "=")
  If (iEqualsPosition > 0) Then
      sRightSide = Mid(sOriginal, iEqualsPosition + 1)
  Else
      MsgBox "Couldn't find an equals to split on"
  End If


Also, there are WinAPI functions to retrieve data from an INI file, if you don't want to write your own.  I can't find a VB example offhand, but try looking for GetPrivateProfileString in WinAPI documentation.
0
 

Author Comment

by:strongd
ID: 1528009
This will work.....thanks


0
 

Author Comment

by:strongd
ID: 1528010
This will work.....thanks


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

721 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