Unable To Understand Enumerator's Reset's Purpose?

Dec 30, 2009

if a call to For Each starts by calling the Enumerator's MoveNext, then Current, then MoveNext, then Current, and so on until MoveNext returns a False then it exits, am i right to say that the Reset is never called?initially i thought that Reset would be called when MoveNext returns False, i tried this (a msgbox would come if it was ever called but i got no msgbox at all)

[code]...

if that's the case, what exactly is the use of the reset in an ienumerator, and is it ok to leave it empty, as such

View 4 Replies


ADVERTISEMENT

Unable To Understand Prefix And Postfix?

Aug 6, 2011

Are you familiar with prefix and postfix? I just wonder how to solve it especially if the expression is too long.

View 17 Replies

[2008] Unable To Understand The Code?

Jan 16, 2009

Can someone explain to me what this is doing.

[code]...

View 4 Replies

List That This Enumerator Is Bound To Has Been Modified - An Enumerator Can Only Be Used If The List Does Not Change?

Apr 25, 2009

For
Each
Item As
DataRowView In
lbOrdersNeedToBeVoided.Items

[code]....

View 6 Replies

Asp.net - Unable To Update Column In Oracle 10g Table Having The Name "PURPOSE"

Feb 24, 2011

Trying to update an oracle 10g table using asp.net and the oracleclient connector Here is the sql syntax:

[Code]...

everything works fine. The column PURPOSE does exist and I am able to INSERT information into the PURPOSE column.

View 2 Replies

Clear And Reset All Of These By Clicking A Reset Button?

Jun 4, 2011

I got on my form textboxes, checboxes but also a groupbox which holds texboxes.

The idea is to be able to clear and reset all of these by clicking a reset button.

At the moment i got this
Private Sub ClearFields()
Dim ctrl As Control

[Code].....

But ofc Me.controls isn't gonna get involved with the stuff in the groupbox.

View 4 Replies

Enumerator Within A USING Block?

Jul 20, 2010

I tried utilizing a collections Enumerator inside of a USING block to take care of the Enumerator.dispose call for me, however, I'm getting NullReferenceExceptions when trying to access the Enumerator.Current property after doing a MoveNext.

[Code]...

View 2 Replies

FadeMode - How To Declare Enumerator

May 21, 2009

I have these variables as shown below. The FadeMode is assigned on of the 3 integer values. I would like it to work like an enumerator, so that when I working with the code editor, IntelliSense offers a choice of the 3 possible values. Like x = Fademode.FadeOut

Const FadeIn As Integer = 0
Const FadeOut As Integer = 1
Const FadePause As Integer = 2
Friend FadeMode As Integer = FadeIn

View 2 Replies

Using An Enumerator To Parse A Collection?

Feb 13, 2009

If I am using an enumerator to parse a collection such as

Code:
''' <summary>
''' Checks to see if Node1 is a direct child of Node2
''' </summary>

[Code].....

The object comparison of Enumerator.Current and Node1 passes an option strict check, but should I for readability and or for any other reason cast it to the correct type? I know their object references will ultimately be checked the same way, but is it generaly bad form to assume this?

Second question. I recently came across the use of the Enumerator v/s a For/Each loop through the collection, does anyone know the pros/cons of the use of either in specifi situations. Where one is favorible to the other or where they should or should not be used?

View 2 Replies

Reset Button To Reset Player

May 29, 2009

Ok, so I am building my own program to control a video player I have through telnet, I have everything else working except one thing.I have a reset button to reset the player, when I press it, it sends the string "Reset" and the unit resets without a problem.But when I add a code to close the winsock connection upon reset, it doesn't send the string to the unit. I am sure what is happening is the winsock is getting closed at the exact same time it is trying to send the string and so it fails to send, how do I make it close winsock AFTER the string has been sent? [code]

View 1 Replies

Construct Enumerator At Runtime From XML File

Jul 17, 2010

I am looking for a way to read an XML file at run time and construct an Enumerator from it. I got the reading and writing all working, it's just getting all the strings to create an enumerator that's the tricky part. I could get them into a collection of strings or maybe a dictionary, but not sure how to go about converting from these into an enumerator. The goal of this is to allow users to add and delete items from the underlying enumerators and eliminate writing hard coded enumerators. My idea is to allow users to extend the program without coding. This is a Winform vb app thats not using any database but just XML files to store and retrieve things.

View 7 Replies

Passing A List's Enumerator To A Function

Dec 2, 2011

It looks like passing a list's enumerator to a function "byval" is quite different than passing it "byref". Essentially, regular "byval" passing will NOT change the caller's "enumerator.Current value", even if the function advances the enumerator. I was wondering if anyone knows why this is the case? Is an enumerator a primitive like an integer, without an object reference, and hence changes to it don't get reflected in the caller?This function is byval, and gets stuck in an infinite loop, spitting out "1" message boxes, because the enumerator's "current" never advances past 5.[code]The difference between the two functions is only whether the listFirstItem__ function accepts a byval or a byref enumerator.

View 2 Replies

For Each Loop Enumerator Expression And Memory Consumption

Aug 15, 2011

According to the language specification guide for VB.NET Section 10.9.3. The enumerator expression in a for each loop is copied over into memory. If I have a list of 10000 objects that list will be in memory twice for the code below?
dim myList as new list(of bobs)
'put 10000 bobs in my list
for each x In myList
'do something
next

If I were generating the list from a linqQuery or some other such query it would make sense to generate that list at the for each loop statement thus not having the list in memory twice for example.
for each x in myList.where(function(x) x.name = Y)
'do something
next

If the LINQ query is unreadable on the for each loop, do I forgo readability and just put it on the for each loop declaration line? Should I declare the list in its own variable and just bite the bullet and have the list exist twice in memory?

View 1 Replies

.net - Access And Understand Old Dll From C#?

Oct 18, 2010

I have been given an old dll and the assignment of accessing it through C# .NET 3.5. I believe the dll was originally built with VB6, but am not positive. There is no documentation or source for the dll aside from an example for how to use the it in VB6. I have been able to succesfully access it through VB.NET 3.5. Example code for accessing looks like this:

myLib = CreateObject("MyLib.api")
myConnection = myLib.CreateObject("NameOfConnectionObject")
myConnection.do_something("abc")

There are several different objects that are created from the library and all of those objects have different methods. I tried using different dll reading tools, but all the export methods show up as garbage. I also tried importing the dll in visual studio, but I get an error stating the dll is not accessible and/or not a COM object or assembly. So, I only know about the methods from the old documentation which is sparse. how to access in C# and/or find out more about this mystery dll?

View 2 Replies

Can't Understand What Constants Are

Apr 24, 2012

i cant understand what constants are.

View 3 Replies

Don't Understand What This Subroutine Is Doing

Dec 4, 2011

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim d As Integer
Dim price(20) As Double ' Adjusted close price

[code]....

What is the for ... next loops in the second subroutine doing? What is the sim() array meaning?

View 3 Replies

Understand The Use Of AT#CLASS = 8

Feb 1, 2009

I have a modem that I've been trying to communicate with only to discover this....went to the modem properties and queried the modem.....

AT+FCLASS = 0,1,8
AT#CLASS = ? COMMAND NOT SUPPORTED

(And I had been trying to use AT#CLASS = 8 all day).So, what does this mean?That the modem is automatically in voice mode (or will automatically choose it's own mode) and forcing it isn't necessary?Still no luck with the connection response messages either -- RING, etc.All I can do is make a call and the called number will appear in a textbox.

View 14 Replies

Build Error Do Not Understand It?

Feb 18, 2011

I am getting a build error. If I try to build again after getting this error, it will build just fine.

View 9 Replies

Cannot Seem To Understand Why Left & Lan Isn't Working

Jan 4, 2011

[code] I cannot seem to understand why left & lan isn't working in the vb 2008 edition

View 2 Replies

How To Understand A MaskedTextBox In Null

Jun 6, 2011

how to understand a msakeditbox in null?

View 4 Replies

Trying To Understand Classes And Objects ?

Jun 5, 2010

I've been trying to understand classes and objects. Yes, I'm thick headed and slow, but I made the decision to go to .Net and I am determined to improve my coding skills to be more efficient. I have spoken to Atma several times on the topic and read most of his posts concerning classes and objects, but still came away a little baffled (He's really advanced for me yet). I needed a simplistic analogy for a reference point to begin understanding. I was reading about OOP written by MikeJ in the following thread/post ...[URL] and it all started to become clear in this statement , but I would like some reassurance that I'm getting it ..."A car IS-A vehicle, while a dog HAS-A tail. The car would be an object declared as type Vehicle, while the dog would have a member that IS-A tail. However, Fido IS-A dog. The dog class is the base template for all dog objects, so when we declare Fido as a dog, Fido is an object. Since Fido IS-A dog, Fido HAS-A tail."

From this I have taken the following understanding...

Vehicle ... ' Class
Car ....... ' Object
Truck ... ' Object
Van ....... ' Object

And from that can I infer that this is true?

Dog ....... ' Class
Fido ... ' Object
Tail .. ' Member of Fido

So to apply this to a program I wrote recently that tracks Generator service...

Generator ' Would be the class
Brand X ' Would be an object
Spark Plug ' Would be a member
Gas Tank ' Would be a member
Brand Y ' Would be an object
Brand Z ' Would be an object

This statement also helped ...

""Class" and "object" are sometimes used interchangeably. However, classes describe the structure of objects, while objects are instances of classes. Each instance is an exact copy of its base class. Because an object is an "instance" of a class, the act of creating an object is called instantiation. To describe it better, a class is a blueprint, and an object is a building based on that blueprint". I can understand this (I think) and it refers to a basic template such as ..."Generator" (my class or blueprint or template) Generators have an engine, powerplant, fuel tank, etc. These are basic requirements to be a generator. (Template or Blueprint) They can differ by Brand of engine, Size of powerplant, and type of fuel used. (Based on template or blueprint) Do I have it down now? MikeJ also made this statement ..."you can't access certain types of class members from outside of the class itself." From this I assume you would need to assign a Global variable the value of the class member if you needed to use it outside of the class?

View 17 Replies

Trying To Understand Code Segment (XML)

Nov 21, 2009

I'm just getting back into VB and was never a pro. The last environment I was in, briefly, was VB6 but spent a good amount of time coding in early VB's back to QB.I'm trying to read RSS feeds and found a nice demo reader but now I want to understand the code I'm seeing:[code]

1. Why does the demo create a new XML to read through an existing XML or is this all in memory as I can't find an actually file? Is this even needed as what I want to do is read the RSS feed, grab some info from it (Source, Title of each story, Date stamp, author and the story text) and then process that in various ways (not actually view it... I want to e-mail specific stories directly to me that fit my search criteria). Or is this just opening the XML out on the web? That would explain why sending it "test" gives me an error saying it can't find "test" in the bin folder as without an HTTP address it goes local.

2. doc.load... what check can I perform here to be certain that the data entered by the user is actually a valid feed? It should, for example, have a first line header that is reliable but is that the best method?

3. Where or how are the elements stored that I can then refer back to pull the data out I want?

4. I don't understand how this part works: navigator.Select("/rss/channel/item/title") Can someone shed some lite on the 4 pieces at the end?

5. I'm assuming the clean-up isn't really needed for e-mail but I didn't remove it as it doesn't seem to harm anything.

View 2 Replies

Trying To Understand How To Write Code

Feb 20, 2011

I have Visual Basic 2010 and also bought a book to study and practice problems. I know how to add controls and assign properties but get confused with the coding part.understand this somewhat?

Here is one problem I am working on-

Write a program to make change for an amount of money from 0-99 cents input by the user. the output of the program should show the number of coins from each denomination used to make change.

Now I know what controls i need on the windows form but I am sorta lost on the coding to make this program work.

View 3 Replies

Trying To Understand SqlDataAdapter.InsertCommand

May 25, 2010

At the following cmd.ExecuteNonQuery() line, I get the following error message: [code] I have followed the example at page [code] as closely as possible, but it does not work.Additionally, I am not sure of the syntax for the length (64) that I have for the BigInt or if it should even have a length.All of the examples that I have found in MSDN uses only parameters with character rather than numberic type. [code]

View 6 Replies

Don't Understand Parameters That Can Be Change And That Cannot Be Changed

Aug 5, 2011

"write sub prototype for a procedure whcih is named my data and has first parameter as a string which can be changed and second parameter of an integer which cannot be change"

View 3 Replies

Understand If A / Any Application Is Running In Fullcreen?

Aug 1, 2010

I want to make an application that will remind me to give a break once in 45-50 minutes. But I want it to determine if I am playing a game or not at the time that I have to give break. In short, if any application is in fullscreen mode (or maybe using graphic card) I want to know. Is there anything about that in .NET?

View 12 Replies

VS 2010 Understand Shadowing Properties?

May 13, 2011

I have created a new usercontrol. My usercontrol contains several other controls like labels, buttons and so on ...When I set the Font property of the usercontrol I want that font property value to propagate down to the child controls.

View 2 Replies

C# - What Is Purpose Of '' Operator In Vb

May 16, 2011

I want to know what is purpose of '' in vb ? I have this statement: frontDigitsToKeep 2 and I want to convert it to C#.

View 2 Replies

What Is The Purpose Behind The OnXXX()

Aug 31, 2010

I just don't understand the OnXXX(). What are they? What do they do? When should you use them?

View 2 Replies

Find A Log File Encoding And Understand It's Structure

Oct 14, 2011

My questions isn't really about a programming language but, since I did not find a general programming forum, I chose this one as I know VB.Net. There's this game, that you might already know, which is called Star Wars Galaxies (And is ending soon actually .. ). For each account and character, the game automatically saves chat logs in a .cht file. A player can have multiple chat channels that have different chat filters (group chat, public chat, etc) and they are all saved in this file. I'm thinking they are probably separated by some kind of a "flag" for the game to be able to detect them.

[Code]...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved