Stuck Understanding OO Concepts?

Dec 14, 2010

so i have a class called FOOTBALL,then another 3 classes/forms that inherit FOOTBALL, they control score (SCOREBOX), possession (POSSBOX), and quarter (QUARTERBOX).the FOOTBALL class has 4 variables, "score" (array of 2 ints), "teams" (array of 2 strings), "possession" (boolean), and "quarter" (int)after that i have another form called MAINBOX, which creates new instances of the 3 classes (SCOREBOX, POSSBOX, and QUARTERBOX) (like this: private scoring = new SCOREBOX)... however they all technically create their own FOOTBALL classes, so I cannot connect them.

View 4 Replies


ADVERTISEMENT

.net - Stop Using Asp Concepts In Asp.net?

Sep 30, 2010

I get the feeling I am still using asp type scripting techniques in the script below instead of proper asp.net scripting...

If this is true, how do I do the below the proper .net way?

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

[Code].....

View 2 Replies

Does VB Support OOPS Concepts

Aug 12, 2010

Does VB Supports OOPS Concepts?

View 1 Replies

[2008] Mixing Different Concepts Together?

Mar 15, 2009

This is my first post as I don't like to ask questions without making sure I've exhausted all other means. I'm new to VB2008 and programming in general but I'm learning. I want to do several simple tasks. Doing each separately is easy but when I put them together I don't know what to do. For one thing to work all the code must be changed and everything else doesn't work.

1. Plot a graph of data from a DAQ. I can do this by using a Timer1_tick method and displaying the data on the linegraph as long as the timer is turned on. I've decided to stick with this method of acquisition. I want to acquire data for long periods of time (perhaps 3 hours) so a timer is pretty good. No problems here.

2. Apply a filter to remove noise from the plot dynamically as the data comes in so that I get a smooth curve instead of a jagged graph. I know I can do this with for loops if I'm using an array. But how do I do it since I'm using a timer? Here the problem begins.

3. Log every piece of the filtered data that the timer is getting to be exported to a CSV file. I learned how to do this with do loops but not with a timer or array. But I really need to use the timer this time.

4. Acquire statistics for the data like maximum value, minimum value, and average value dynamically as the data changes. I know how to do this with an array of data after all the data is acquired. But How do I do this with a timer while the data is still being collected?

5. Monitor the data coming in to execute an alarm (Or event, like stopping the acquisition) when the data coming in has plateaued and is constant (eg: The voltage I'm monitoring starts to become constant and becomes one constant value) - Ok I don't know anything about this.

6. Execute a mathematical operation on the data that has been acquired (post acquisition) like finding gradients and such. Basically this means "How do I now manipulate the data I have and where is this data stored?"

Here's my starting code that gathers data with a timer. How do I work from here?:

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As
System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Timer1.Enabled = False

[code]....

View 3 Replies

[VB 2008] Merging Different Concepts Together?

Mar 15, 2009

I want to do several simple tasks. Doing each separately is easy but when I put them together I don't know what to do. For one thing to work all the code must be changed and everything else doesn't work. I want to:

1. Plot a graph of data from a DAQ. I can do this by using a Timer1_tick method and displaying the data on the linegraph as long as the timer is turned on. I've decided to stick with this method of acquisition. I want to acquire data for long periods of time (perhaps 3 hours) so a timer is pretty good. No problems here.

2. Apply a filter to remove noise from the plot dynamically as the data comes in so that I get a smooth curve instead of a jagged graph. I know I can do this with for loops if I'm using an array. But how do I do it since I'm using a timer? Here the problem begins.

3. Log every piece of the filtered data that the timer is getting to be exported to a CSV file. I learned how to do this with do loops but not with a timer or array. But I really need to use the timer this time.

4. Acquire statistics for the data like maximum value, minimum value, and average value dynamically as the data changes. I know how to do this with an array of data after all the data is acquired. But How do I do this with a timer while the data is still being collected?

5. Monitor the data coming in to execute an alarm (Or event, like stopping the acquisition) when the data coming in has plateaued and is constant (eg: The voltage I'm monitoring starts to become constant and becomes one constant value) - Ok I don't know anything about this.

6. Execute a mathematical operation on the data that has been acquired (post acquisition) like finding gradients and such. Basically this means "How do I now manipulate the data I have and where is this data stored?"

7. Know any good free linegraphs with autoscaling?

Here's my starting code that gathers data with a timer. How do I work from here?:

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As
System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Timer1.Enabled = False

[Code].....

View 5 Replies

C# - Use The Multithreading Concepts And Deadlock Concept?

Mar 27, 2009

I will connect with one database from several machines. In all machines they need to insert the data in single table. In that time: how to use multithreading and deadlock concepts? Using the MySQL database and also MS Access.

View 2 Replies

Forms :: Any Way To Implement Inheritance Concepts?

Jul 4, 2009

I m new to vb.net need some ideas about how to implement inheritance concepts in vb.net

View 1 Replies

Game, Unable To Grasp Certain Concepts?

Jul 1, 2010

Ok, I've researched for hours about classes, creating classes, creating obj's of that class, but every tutorial I've seen has either talking about things that are different from what I'm doing, or they were written with the assumption that I understand X or Y. What I want seems simple enough but it's just not clicking. Here's what I'm trying to accomplish:

1. Player chooses from a list of characters
2. That character has specific attributes (power level, experience points, ect..)
3. When entering the combat page, the specific attributes are displayed in text boxes
with respective labels.
4. When battle is over, experience points are handed out and saved in player class.

It's probably laughable to some how simple this is but I'm really struggling with it.

View 1 Replies

Same Project Concepts And Funtions But Different Outputs?!

Sep 12, 2010

I started programming 6 months ago, Visual Basic is kind of easy and I made lots of programs. Now I am confused now. I have a serious problems about DLL's but I didn't made them but I knew how to make use of them. Okay I have 2 programs and one was having a problem and other one has no problem, they have the same framework, same code, but they have problems.url...

View 12 Replies

Vb Figthing Game Concepts/Thoughts?

Jun 11, 2012

Recently I decided it might be kind of neat to make a "fighting' game in Vb similar to a Mortal Kombat or Street fighter style game. If I understand everything it should be mostly collision detection and a lot of animation? What does everyone else think?

View 2 Replies

Write A Single Program That Uses OOP Concepts?

Mar 11, 2010

I am very new to VB.NET coding..My manager assigned me to write a Single Program that uses OOP concepts like Abstraction,Encapsulation,Inheritence and Polymorphism.As there is a time limit.

View 1 Replies

[2008 Express] Merging Different Concepts Together

Mar 15, 2009

This is my first post as I don't like to ask questions without making sure I've exhausted all other means. I'm new to VB2008 and programming in general but I'm learning. I want to do several simple tasks. Doing each separately is easy but when I put them together I don't know what to do. For one thing to work all the code must be changed and everything else doesn't work.

[Code]...

View 1 Replies

Understanding The PDF DOM

Apr 29, 2011

I am writing an application that has to read and interpret data stored in some PDF files. The reading part is done but I am only able to get a dump of all the words on a page and not the format of the words. What I mean is that if I have to extract a table, I am getting the numbers in the table but not the markup which defines the table.

Further, there is some formatting used which displays a few of these numbers within parentheses (meaning that those numbers are negative) but the parentheses themselves are not part of the text. Hence, I am not able to distinguish between positive and negative numbers present in the PDF table!

How do you get the PDF markup along with the text? Is a PDF similar in structure to an XML with tags used to markup tables etc.? If not, then, is there a resource which describes the salient features of the PDF DOM? I am using VBA and the Acrobat library (AcroExch etc.)

View 4 Replies

Understanding And Using Predicates

Dec 7, 2009

I am trying to use my first predicate and I generate the error:Method 'Public Function FindIndex(list As MyProgram.HTMLFiles) As Boolean' does not have the same signature as delegate 'Delegate Function Predicate(Of T)(obj As String) As Boolean'.[code]

View 12 Replies

Understanding RTF And Edit It

Mar 15, 2010

I have this RichTextbox in my vb.net form and I would like to when a user click a button, for example to embold the selected text, how would I do this.Also, I do NOT want to use the standard vb.net expressions such as RichTextBox1.SelectedText.Font.Bold = true. I want to do something like RichTextbox1.SelectedRTF="[bold]" & RichTextBox1.SelectedRTF & "[/bold]" or whatever RTF looks like.Can I just add the RTF options random places or can a RichTextBox return an error if the text is in wrong format. I'm mostly looking for info on how to work with RTF without using the standard vb expressions.

View 1 Replies

Understanding Use Of DWORD

Jun 16, 2010

My goal is to read a data streaming from a machine the streaming is divided in tre main parts,the first is a 10 byte array that declare the length of the second and third part.The second one, the header, is a 22 DWORD (*32bit) ( 88 byte ) structured of mixed data types.I can easly read the value inside this header when the DWORD contains just one information using something like: [code] My problem starts because some of these DWORD contains several indipendent informations, for example DWORD #4 [ channel 2 peaks 31..16] [channel 1 peaks 15..0].For what I understood the first 16 bits ( so 2 bytes) are used to store the information of the first channel , while the second 16 bits are used for the second channel, I tryed converting the first 2 byte with System.BitConverter.ToUInt16()but without success.Can someone explain me what to do and how these numbers are supposed to be stored?

View 6 Replies

Error: A First Chance Exception Of Type 'System.NullReferenceException' Occurred In Click Game Concepts.exe

Nov 29, 2011

Here are parts of my

Dim setting As My.MySettings
lvl As Integer
Dim xp As Integer
Dim xpt As Integer

[code]....

I have done the settings as type integer and set the values that I wanted but I get this error: A first chance exception of type 'System.NullReferenceException' occurred in Click Game concepts.exe

View 10 Replies

Understanding Event Statement?

May 29, 2009

I started out with VB.NET but now mostly do C#. I never really got to grips with events in VB. I'm trying to translate an old VB.NET program (from 2002) into C#. I've dealt with everything apart from statements such as these:

Public Event UpgradeProgress(ByVal strProgressString As String, _
ByVal strCurrentFile As String, ByVal intProgressPercent As Integer, _
ByVal lngTimeRemaining As Long, ByRef blnCancel As Boolean)

[code]....

View 4 Replies

Understanding In-memory Compiling

Feb 27, 2010

It is my understanding that in .Net 4.0, VB will have an in-memory compiler.

I have to admit I don't know a lot about the compilers so I'm trying to understand the advantage of this as compared to what we had before this. Also, will C# be coming out with the same type of compiler?

View 2 Replies

VS 2008 Understanding HtmlElementCollection?

May 25, 2012

I'm confused on the results of this code. The results extracts the tag "div" but why isn't the results containing the word "Yoga"? Shouldn't the result have only one element because it should exit the for loop after finding the first element? The results show hundreds of elements

Dim ElementCollection2 As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("div")
For Each curElement As HtmlElement In ElementCollection2

[code].....

View 4 Replies

Annotating Some Code And Understanding What Arrays Are Doing?

Dec 1, 2011

I wanted to know what the main areas are and what the array is actually doing in the code. I know that dim is declaring the variables, but how do i exactly explain this code line by line.

PS: the areas in red are the main areas im trying to understand annotate.

Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub

[code]....

View 4 Replies

Homework - Net Abstract Class Understanding?

Dec 28, 2011

If i have a class called A and a class called B, if B inherits A that means A is the super class and B is the subclass. I have been asked to describe why class A is not an abstract class but as i see it class A is an abstract class A, as it has been created for Class B to use in the future, is it something to do with Class B not being able to access the fields in Class A as although they are private by default?

[Code]...

View 3 Replies

Multithreading - Understanding The Way Application.Run() Works?

Nov 4, 2010

As far as I understand from the docs, it seems that Application.Run() starts a message loop on the current thread, which in turns enables it to process user input (Is that right?).The overloaded version Application.Run(Form) basically does the same, only it exists when the form closes, and it shows the form by default.timer ticks after 20mns, and has to execute say approx. 15 tasks one by one, every time creating an instance of a progress dialog, initially hidden in the taskbar.

View 1 Replies

Understanding AndAlso - Get A Runtime Error?

Oct 5, 2011

Looking at the following code snippet in VS2008 (this is from the SBS book)

Dim HumanAge As Integer = 0
If HumanAge <> 0 And 7 / HumanAge <= 1 Then
MsgBox("1 dog year or older")[code]....

I expect to get a runtime error, because And evaluates both conditions, which is why in this case AndAlso should be the better operator to use. When I try this code there is no difference in behavior between 'And' & 'AndAlso'. In neither case I get a
runtime error, not even when I flip the conditions around. Is this by design, a lucky accident, or do I just not get it?

View 5 Replies

Understanding ItemsSource And DataContext In A DataGrid?

Jun 14, 2010

UPDATE: See the bottom of this question for what I did to solve the problem.I'm trying to understand how the ItemsSource and DataContext properties work in a Silverlight Toolkit DataGrid. I'm currently working with dummy data and trying to get the data in the DataGrid to update when the value of a combo box changes.

View 2 Replies

Understanding Object Aggregation And Databases

Aug 24, 2010

I have a situation in a program I'm writing where I'm not sure of the best way of coding a couple of objects and was hoping for a few pointers.I am using VB.NET 2003, so F/wrk v1.1. My business is horticultural in nature and I'm trying to help streamline the business with a new order fulfillment app.In my program, I have products. Some products don't have any component parts, but others are made up of a selection of plants.For example: we sell a trowel, which obviously doesn't have any component parts. But we also sell a large vegetable garden, which is made up of, say, 20 rocket plants, 30 salad plants, 5 spring onions, etc.[code]I believe the ProductContents table is technically referred to as a 'join table'?

I have written the classes in VB.NET which load, save, edit the Products and the Plants. I also have Manager classes which store collections of these objects (ProductMgr, PlantMgr).I have dealt with situations before with join tables where there are only two columns which are both FKs and both make up a composite PK (ie - to express a one-to-many relationship). This is pretty straightforward (using my product/plant tables as an example) because when I load an individual Product from the database, I also run a second SELECT query which returns any PlantIDs associated with that PlantID from ProductContents. I store that in an array of integers within the Product object. I can then load Plants from the PlantMgr object based on the PlantIDs stored in this array. I kind-of do the reverse when I save the Product to the database, I run a second INSERT query which updates the ProductContents table with the Plants associated with the Product.Where I'm getting stuck is with the inclusion of the extra 'Quantity' column. I can no longer store the PlantIDs in an array of Integers because I also need to store the Quantity associated with that Plant. I also can't use the PlantMgr object any more (to express which Plants are in each Product) because it also doesn't include any information about Quantity.I was just wondering if there is a standard way of handling this kind of situation, where I have a 'join table' which also includes extra columns as well as the two columns that identify the join.

View 1 Replies

Understanding Why FTP Upload Doesn't Work?

Apr 3, 2012

I'm trying to figure out why the following VB.Net code seems unable to upload a file to my ISP's FTP server, since it doesn't report any error but I'm not getting the notification e-mail I'm supposed to receive once a file has been uploaded.So I launched the free Fiddler proxy on 127.0.0.1:7777, but it doesn't report any activity, even with its "Capture FTP Requests" option checked:[code]Is there a way to watch the FTP session to understand why the file seems to be uploaded successfully but I'm getting no success notification?

View 4 Replies

Understanding Xml - Saving, Loading, Manipulating?

Aug 15, 2009

a member mentioned, xml is similar to a txt file. txt files, i can manipulate quite well. so, if this is the case, it should not be to complicated to do as the thread title describes . that, of course is, if you already know how to even create an xml file. i do not. any and all input/suggestions welcomed, links for xml noobing welcomed as well.

i like: VB General google fast cars username password

View 11 Replies

VS 2010 : Understanding A Tick Method?

Nov 27, 2011

I am working on a project, but the latest enhancement to it has me stumped currently. Here is what the class enhancement asks for:

Modify class time to provide a Tick method that increments the time by one second. Also provide methods IncrementMinute to increment the minute and methods IncrementHour to increment the Hour. The Trick method, the IncrementMinute method and the IncrementHour method should be called when you click the Add 1 to Second button, the Add 1 to Minute button and the Add 1 to Hour button, respectively. Be sure to test the following cases:

A) Incrementing into the next minute.

B) Incrementing into the next hour.

C) Incrementing into the next day (that is, 11:59:59 PM to 12:00:00 AM).

Here is my GUI:

The reason I am confused is currently my program already increments the seconds, minutes, and hours correctly (as shown in pic) for Cases A, B, C. But, I haven't added a Tick method which is what the enhancement to the class Time calls for. Here are the 2 classes I have so far:Time Class that the Tick method is supposed to be added to

Public Class Time
' declare Integer instance variables for the hour, minute and second
Private hourValue As Integer ' 0 - 23
Private minuteValue As Integer ' 0 - 59

[code]....

View 2 Replies

.net - Understanding AddHandler And Pass Delegates And Events

Mar 17, 2010

I am using AddHandler to wire a function to a control's event that I dynamically create:

[Code]...

This code is generating a run-time exception stating: Unable to cast object of type 'MyEventHandlerDelegate' to type 'System.EventHandler' What am I not understanding about System.Delegate even though AddHandler takes as an argument of type "System.Delegate"? What Type does "EventHandler need to be to cast to a type that AddHandler can accept?

View 3 Replies







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