VB Is Using Structures Considered Good Or Bad?

Oct 10, 2010

I use to use Structures quite a lot in the VB6 days, and try to avoid them now with .NET. Just wondering if using structures in 2010 instead of a Class is considered nasty?

View 6 Replies


ADVERTISEMENT

(2005) Arrays Of Structures Within Structures?

Jan 20, 2009

I have a structure called 'Scheme' and in my program I want (ideally) an ArrayList of 'Schemes' (so i can add, remove schemes etc.). However, within the 'Scheme' structure, I want to have an ArrayList of 'Item''Item' is another structure. Are there any solutions out there for iterating through these arrays quite easily?

How can I easily add multiple Items to a Scheme and mutliple Schemes to my Scheme array. Code is below. When I try to add Items to a Scheme, I get the 'Object not set to a reference of an object, try the 'New' keyword', but you cannot declare 'New' keywork within a structure.

[Code]...

View 4 Replies

Using Modules In .NET Considered?

Jun 7, 2011

During the design of a new application I was wondering if using a module with properties is considered to be a bad practice. Some example code:

Module modSettings
public property Setting1 as string
public property DatabaseObject as IDatabaseObject
End Module

The code above is just an example to emphasize my question. In the past, this structure was used a lot in VB6. In the past I used it as well in my .NET projects.

But nowadays with buzzwords like Dependency Injection, Testability and Separation of Concerns the above structure smells bad. I can't really describe why, but it just feels wrong. I must admit I'm not very familiar with the keywords above, yet.So I'm wondering whether the above code really is a bad practice. If so, what would you use a Module for?

View 4 Replies

What Would Be Considered A .NET Module In C#

Mar 16, 2011

VB.NET has classes and Modules, so my first question is what is the difference? Also, I noticed that C# does not have modules, but just classes, is there something in place of modules or were they removed for C#?

View 1 Replies

Is Backspace Considered Character

Oct 18, 2010

You need to test for the backspace character, and if it's there, fix up the input.Maybe something like this:

If Right$(TxtQP.Text, 1) = vbBs Then
TxtQP = Left$(TxtQP, len(TxtQP)-1)
End If

Or is the backspace not showing up in the string, but as the input character kicking off your procedure?

View 1 Replies

Which One Cannot Be Considered As A Counter Variable

Feb 15, 2012

which one cannot be considered as a counter variable?

counter = counter +1
counter = counter -1
counter = counter +3
counter = counter *2

View 10 Replies

Is Using GoTo<label> ALWAYS Considered Bad Practice

Aug 23, 2011

I'm just wondering why using GoTo<label> is so frowned upon?I'm learning VB, and I want to develop good habits as I go. One thing I don't entirely understand, is why everyone avoids GoTo like its the plague (except in error handling...). I feel like GoTo could be useful in some situations.

View 1 Replies

VS 2010 - Timer Event Is Not Considered

Nov 18, 2011

Why after you pressed the button Button1, this application crashes without considering the event timer1??
Public Class Form1
Public timer_event As Boolean
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
timer_event = False
Timer1.Interval = 3000 '3 sec
[Code] .....

View 3 Replies

When Was Isnumeric Considered Legacy Code

Jan 3, 2012

When was isnumeric considered legacy code? I guess all that i have learned from my college class last semister is legacy.

View 4 Replies

Structures And Arrays Of Structures?

Jun 2, 2010

I read in the Book "Mastering Microsoft Visual Basic 2008" about "User-Defined data types".The example given is creating a Structure as follows.I wanted to check that so I wrote all the code given; I used a TextBox and a Button for this.(I didn't include the "CheckDate" here; that is in the book)

Structure CheckRecord
Dim CheckNumber As Integer

[code]....

The problem is this does work.What I get is "00000". and I found out that the "Checks(4)" Array does hold any value ie: on keeping the cursor over that, it shows "CheckAmount 0.0, CheckNumber 0 , CheckPaidTo Nothing ".

View 1 Replies

VS 2008 - Are Arrays Considered A Type Of Collection Like Lists

Mar 2, 2010

Ever since I started using VB.Net I have been using the Generic List collection List(Of <Type>). Arrays, I haven't used so much. I used them a lot more when I wrote C code years ago.

1.) Are arrays considered a type of collection like Lists, Dictionary, Queue etc are? Or are they in their own category.

2.) Can I iterate over an array with a For Each loop like I can with other collections or do I stick with the normal For loop for arrays?

3.) There are certain methods that return arrays. Can I set a list object to hold this return value instead of an array?

View 6 Replies

Create A List Of Structures Within A List Of Structures?

Jul 20, 2009

I'm attempting to create a list of structures that contains a list of structures. I can't seem to figure out how to properly allocate the object for the inner list of structures. I expect the outer list of structures to have a couple thousand entries and the inner list of structures to be fairly small at 2 to 10. Both lists will grow over time but the number of elements within the inner list will be constant for an instance of the outer list. Meaning, if an instance of the outer list has 2000 entries each of those will have the same number of elements on the inner list, say 4 entries.

Here is a simplified code fragment. This fragment makes no attempt to create the instance of the inner list "StructBlist" since I can't figure out where to put it. Tried "New List(Of StructB)" in the declaration as well as "Alist(0).StructBlist = New List(Of StructB)" but neither works.

Public Class Form1
Structure StructA
Dim FieldA1 As Integer

[Code]....

View 5 Replies

Different Between These 2 Structures?

Mar 28, 2010

What is the different between these 2 structures?

Structure INPUT
Public dwType As InputType
Public mi As MOUSEINPUT
Public ki As KEYBDINPUT
End Structure

[Code]...

View 1 Replies

Good Way To Use DocumentCompleted

Aug 15, 2011

This is a good way to use DocumentCompleted using AddHandler (good for a tabbed web browser) [code] Of course,.you can adapt this for a tabbed WebBrowser by replacing me.text with tabcontrol1.SelectedTab.Text.

View 1 Replies

2 Structures Using Eachother?

May 14, 2011

Structure TextureStruct

Dim unk1 As ULong 'always 0x70007
Dim unk2 As ULong 'always 0x70007
Dim unk3 As ULong 'always 0x70007
Dim unk4 As ULong 'always 0x70007
Dim unk5 As ULong 'always 0x70007
Dim unk6 As ULong 'always 0x70007

[Code]...

View 4 Replies

Get A List Of Structures?

Jun 5, 2010

Is it possible to declare a new list inside a structure.

I'm trying to get a list of structures that each contain a list of points,

but when i try to declare a new list inside the structure VB says "keyword not valid as an identifier"

View 2 Replies

Using Arrays In/with Structures?

May 24, 2009

I'm currently doing this project where i have to create a program that let's the administrator manage students (and their tests.) I have decided to use Random Access file in this project.because structures will need fixed lengths...i don't know how will i search through the students (a function of the program) when each student structure has a different length because of the number of tests they've done.* I have created a variable in the aStudent structure so that i can know the number of tests a student has done...but don't know how to use it.

Public Class FormAdmin
Dim currentStudentName As String
Dim currentStudentID As Integer = 0

[code]....

View 3 Replies

Using Arrays With Structures?

Jun 18, 2011

I have created a structure as below. I want the structure to be an array...so I can use a call like picks(1).a or picks.a(1) = blah blah. I don't understand how to use an array of a structure..

Public Structure apicks
Dim a As String
Dim b As String
End Structure

View 3 Replies

Using The Nested Structures

Mar 8, 2010

I have been trying to read the cd toc in one go from the API, I can read it OK with a single byte array, but I can't find a way to fill the formatted arrays

Code:

'ORIGINAL STRUCTS
'MAXIMUM_NUMBER_TRACKS = 99
'typedef struct _CDROM_TOC {
' UCHAR Length[2];

[code].....

View 2 Replies

C# - Good 3270 Emulator (.NET)

Jun 24, 2011

What is a good 3270 emulator(which can login, scrape screen, find text, send keys etc. in background) for .NET(win n web). Something very similar to [URL](apparently zephyr costs like $5k per year, which is quite a lot, for one pc).

[Code]...

View 2 Replies

Good / Updated Tapi Sdk?

Aug 12, 2010

Does anyone know if Visual Studio 2010 has a good/Updated Tapi sdk? Or Does any one know where I can get a Tapi Sdk that is in .Net format?

View 1 Replies

Good ASP / SQL Program Book?

Apr 21, 2010

I am starting off in the .NET world and wanted to know what a great beginner book would be that would explain how to use asp.net, vb and SQL.

I hear "Learning Visual Basic" is a good series but wanted to see if there were anymore out there.

View 1 Replies

Good Idea For An Easter Egg To Put Into App?

Jun 3, 2009

So I'm on the way out of the woods for my latest app, which will have users across the nation.I'd like to put in an Easter Egg, but ideas are escaping me.Does anyone have a good idea for an Easter Egg to put into my app?

View 15 Replies

Good Scientific Calculator Example?

Apr 16, 2010

Show me a link to the source of a good scientific calculator example?

I'm using VB express 2008. I've been searching, but I can't find any good ones that work with express 2008!

View 6 Replies

Good To Use Flash On Map Image

Mar 15, 2010

im planning to create a n GIS..and its good to use flash on map image.

View 2 Replies

Good Way To Do What GetAsyncKeyState Does On System?

Aug 31, 2009

I have looked at many of the tutorials, however, using 64-bit windows vista home premium using those examples, it doesnt seem to work, however, I don't have other computer to test on, is there a good way to do what GetAsyncKeyState does on my system?

View 7 Replies

Good Word To PDF Convertors?

Jul 29, 2009

I realize that this would mean a third-party component and I've looked at a few. Does anyone use/know of a component that they would recommend to get reliable, quality Word to PDF conversion via a VB.NET application?

Anyone know of any cheaper options that will do a good job? I tried a couple of cheaper RTF to PDF convertors, saving the Word doc as RTF via the app but the PDF they output lost formatting on Word tabs, table of contents, page numbers, etc. Not good enough.

Otherwise, I will have to tell the app users they will need to convert the Word doc to PDF themselves (unless they have Word 2007 and pdf add-in which I can probably offer as an option).

View 4 Replies

Set Variables To 'Nothing' Is A Good Practice?

Jan 27, 2011

If I got Dim myRect As Rectangle = New Rectangle(0,0,100,100)Is it necessary or just fine to later do this: myRect = Nothing Or it isn't necessary?IF it is necessary, are there other cases it isn't for my variables?

View 2 Replies

VS 2008 Is Good For A ListView?

Dec 26, 2009

In my VB6 project I had eight list boxes in an array. I was able to create a command to move to the next listbox by adding one to the index. I was able to move to the next selected item in the listbox with a command also.All the data in my arrayed listboxes: I was wondering if I could put into a ListView with multiple columns in VB2008 (each column would have the items from the listboxes mentioned before).

If they were in a ListView, would I be able to work in each column by moving to the next item with a command like I did before, and then move to the next column of items with a separate command?

I was thinking it would be easier to do that than array all those listboxes again.

View 1 Replies

What Are Some Good Websites For .NET Tutorials?

Mar 15, 2012

Does anyone have any good .NET Tutorials? What are some good websites for .NET Tutorials? Sorry if this is in the wrong section. I don't know enough about .NET to ask in the right section.

View 3 Replies







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