| | |
2 Questions from a student
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2008
Posts: 27
Reputation:
Solved Threads: 0
look this ...why is not the same?
the second one setd2 give me a error... is not the same using =??
Which is the difference???
and...
Is this the same...o are Different? and again
Which is the difference??
VB.NET Syntax (Toggle Plain Text)
Dim azar As New Random setd1(azar.Next(1, 7)) setd2=(azar.Next(1, 7))
the second one setd2 give me a error... is not the same using =??
Which is the difference???
and...
VB.NET Syntax (Toggle Plain Text)
Dim dados As New dado dim dados2 as dado
Is this the same...o are Different? and again
Which is the difference??
Hi
What is "setd1" and "setd2"?
i am not sure what is happening, but it looks to me that they are procedures that dont return anything, maybe?
about the second one,
the first one you are creating a new object/variable (hence the word new) of type dado; the second one you are declaring a variable that probably has not been initialized yet.
hope it helps.
- Tutankamon
What is "setd1" and "setd2"?
i am not sure what is happening, but it looks to me that they are procedures that dont return anything, maybe?
about the second one,
VB.NET Syntax (Toggle Plain Text)
Dim dados As New dado dim dados2 as dado
the first one you are creating a new object/variable (hence the word new) of type dado; the second one you are declaring a variable that probably has not been initialized yet.
hope it helps.
- Tutankamon
•
•
Join Date: Jun 2008
Posts: 27
Reputation:
Solved Threads: 0
yeah both are sub....
besides I have one more question........
I am new..in this modules.class...type..is really hard to me when I need to know when use a sub or when I need use a function..like this
I need to know..juan,maria,and pedro age...and I want to know if are equal ...
this easy but I am confuse...if I need use a if...in a sub or in a function..
I have this
besides I have one more question........
I am new..in this modules.class...type..is really hard to me when I need to know when use a sub or when I need use a function..like this
I need to know..juan,maria,and pedro age...and I want to know if are equal ...
this easy but I am confuse...if I need use a if...in a sub or in a function..
I have this
VB.NET Syntax (Toggle Plain Text)
Public Class calcular Private juan, maria, pedro As Byte Public Sub setjuan(ByVal value As Integer) juan = value End Sub Public Sub setmaria(ByVal value As Integer) maria = value End Sub Public Sub setpedro(ByVal value As Integer) pedro = value End Sub Public Function getjuan() Return juan End Function Public Function getmaria() Return maria End Function Public Function getpedro() Return pedro End Function End Class
ah, although this would work, you are doing it the wrong way.
Usually to set and get the proprties of a class you use the set and get
what you might want to do is to create a class "person" and with some properties like age, weight, height, etc. Then create an object for each person.
something like this:
something like this.
Usually to set and get the proprties of a class you use the set and get
VB.NET Syntax (Toggle Plain Text)
Public Property X() As Integer Get Return x End Get Set(ByVal Value As Integer) x = value End Set End Property
what you might want to do is to create a class "person" and with some properties like age, weight, height, etc. Then create an object for each person.
something like this:
VB.NET Syntax (Toggle Plain Text)
public class person private age, weight, height as integer ' set your properties here. end class sub main() dim juan, maria pedor as person juan.age = 21 maria.age = 30 pedro.age = 40 dim ageDiff as integer = maria.age - pedro.age end sub
something like this.
Last edited by williamrojas78; Aug 26th, 2008 at 4:22 pm.
![]() |
Similar Threads
- Student Suspended for using PHP!! (IT Professionals' Lounge)
- Questions re possible software bug (Geeks' Lounge)
- Questions about software engineering (Geeks' Lounge)
- Who can help a student with her exams in Java?? (Java)
- Quiet student (Computer Science)
- Questions about Hp Pavillon MOBO 500 series (Motherboards, CPUs and RAM)
Other Threads in the VB.NET Forum
Views: 339 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 2008 access add application array assignment basic box button buttons center class click code combo convert cpu data database datagrid datagridview design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees error excel exists firewall function image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan picturebox port print printing printpreview problem record refresh regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml





