473,614 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loop problem at runtime

Here is my code:

Dim sr1 As StreamReader = New StreamReader(Ap plication.Start upPath &
"\Controls.ini" )

strGameExists = "no"

intCheck = 0

Do

strLine = sr1.ReadLine()

intCheck = InStr(strLine, "[" & strParentName & "]")

If intCheck > 0 Then

strGameExists = "yes"

End If

Loop Until intCheck > 0 Or strLine Is Nothing

sr1.Close()

If strGameExists = "yes" Then

do something

else

do something else

End if
The code works great in the debugger. It finds the string, sets
strGameExists to "yes" and executes my code. However, at runtime it always
executes my do something else code. Am I missing something here?

Thank you,
John


Nov 20 '05 #1
34 1279
"jcrouse" <me> wrote in news:uV******** ******@TK2MSFTN GP11.phx.gbl:
Dim sr1 As StreamReader = New StreamReader(Ap plication.Start upPath &
"\Controls.ini" )


BTW, out of curiousity... any reason why you're using a .ini file instead
of an app.config file?

An app.config is in XML so it's much easier to read from.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #2
That doesent answer the OP's questions Lucas.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Lucas Tam" <RE********@rog ers.com> wrote in message
news:Xn******** *************** ***@140.99.99.1 30...
"jcrouse" <me> wrote in news:uV******** ******@TK2MSFTN GP11.phx.gbl:
Dim sr1 As StreamReader = New StreamReader(Ap plication.Start upPath &
"\Controls.ini" )


BTW, out of curiousity... any reason why you're using a .ini file instead
of an app.config file?

An app.config is in XML so it's much easier to read from.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 20 '05 #3
If strGameExists = "yes" Then '<<<<<<< Debug value here for strGameExists
is ?????

do something

else

do something else

End if
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"jcrouse" <me> wrote in message
news:uV******** ******@TK2MSFTN GP11.phx.gbl...
Here is my code:

Dim sr1 As StreamReader = New StreamReader(Ap plication.Start upPath &
"\Controls.ini" )

strGameExists = "no"

intCheck = 0

Do

strLine = sr1.ReadLine()

intCheck = InStr(strLine, "[" & strParentName & "]")

If intCheck > 0 Then

strGameExists = "yes"

End If

Loop Until intCheck > 0 Or strLine Is Nothing

sr1.Close()

If strGameExists = "yes" Then

do something

else

do something else

End if
The code works great in the debugger. It finds the string, sets
strGameExists to "yes" and executes my code. However, at runtime it always
executes my do something else code. Am I missing something here?

Thank you,
John

Nov 20 '05 #4
Terry,
That doesent answer the OP's questions Lucas.


However in my opinion not forbidden to ask, this is a newsgroup meant to
learn from each other. Everybody can has a reason why he use an INI file
instead of an XML file so how more reasons you know how better it is to make
own decisions in that.

Just my thought about a newsgroup.

Cor
Nov 20 '05 #5
Sure, I was just pointing out that some help along with the question would
have been nice !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:e%******** ********@TK2MSF TNGP10.phx.gbl. ..
Terry,
That doesent answer the OP's questions Lucas.
However in my opinion not forbidden to ask, this is a newsgroup meant to
learn from each other. Everybody can has a reason why he use an INI file
instead of an XML file so how more reasons you know how better it is to

make own decisions in that.

Just my thought about a newsgroup.

Cor

Nov 20 '05 #6
Actually, a better reply would have been ( And this includes mine ) along
the lines.

1.) Here is how to look at your problem/slove it.

2.) Did you know, there are several other ways to store information about
x,y,z, here they are. . .
Some text
Link

Some text
Link

Some text
Link

If you need more help, please post back to the NG
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:e%******** ********@TK2MSF TNGP10.phx.gbl. ..
Terry,
That doesent answer the OP's questions Lucas.
However in my opinion not forbidden to ask, this is a newsgroup meant to
learn from each other. Everybody can has a reason why he use an INI file
instead of an XML file so how more reasons you know how better it is to

make own decisions in that.

Just my thought about a newsgroup.

Cor

Nov 20 '05 #7
Terry
1.) Here is how to look at your problem/slove it.

2.) Did you know, there are several other ways to store information about
x,y,z, here they are. . .

As we try to do it, however when someone has no solution however is curious
why?

Maybe he is curious for himself because everybody has told that an XML file
is better and now there is somebody who stays with the INI file so he wants
to know why, just for is own purpose.

However basicly we agree, (in what I had no doubt)

Cor
Nov 20 '05 #8
* Lucas Tam <RE********@rog ers.com> scripsit:
Dim sr1 As StreamReader = New StreamReader(Ap plication.Start upPath &
"\Controls.ini" )


BTW, out of curiousity... any reason why you're using a .ini file instead
of an app.config file?

An app.config is in XML so it's much easier to read from.


I doubt that it's easier to read. It's much more complicated to parse.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #9
* "One Handed Man \( OHM - Terry Burns \)" <news.microsoft .com> scripsit:
Actually, a better reply would have been ( And this includes mine ) along
the lines.


It simply doesn't matter. Every post that adds something to the
discussion is valuable, irrespective of its completeness.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #10

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

Similar topics

47
12163
by: Mountain Bikn' Guy | last post by:
Take some standard code such as shown below. It simply loops to add up a series of terms and it produces the correct result. // sum numbers with a loop public int DoSumLooping(int iterations) { int result = 0; for(int i = 1;i <=iterations;i++) { result += i;
34
2668
by: Frederick Gotham | last post by:
Is the domestic usage of the C "for" loop inefficient when it comes to simple incrementation? Here's a very simple program that prints out the bit-numbers in a byte. #include <stdio.h> #include <limits.h> #include <stdlib.h> int main(void) {
10
1853
by: Derek Hart | last post by:
I am going in circles trying to loop through properties on 3rd party controls. For example, I have a textbox that has its maximum length located at MyTextBox.Properties.MaxLength - instead of the dotnet textbox which is MyTextBox.MaxLength. If I loop a built in dotnet control, it finds the property no problem. But looping through the 3rd party control, Properties.MaxLength does not get listed. I was hoping to find how it names it using...
0
8179
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8124
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8621
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8272
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6087
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5538
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4119
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1712
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1421
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.