|
-
Mar 3rd, 2004, 03:59 PM
#1
-
Mar 3rd, 2004, 04:16 PM
#2
Frenzied Member
VB Code:
Structure MyStruct
Private Shared x As Integer = 25
Private Shared y As Integer = 50
Public Sub SetXY(i As Integer, j As Integer)
x = i
y = j
End Sub 'SetXY
Public Shared Sub ShowSum()
Dim sum As Integer = x + y
Console.WriteLine("The sum is {0}", sum)
End Sub 'ShowSum
End Structure 'MyStruct
Class MyClient
Public Shared Sub Main()
Dim ms As New MyStruct()
ms.SetXY(100, 200)
MyStruct.ShowSum()
End Sub 'Main
End Class 'MyClient
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Mar 3rd, 2004, 04:17 PM
#3
Originally posted by Memnoch1207
VB Code:
Structure MyStruct
Private Shared x As Integer = 25
Private Shared y As Integer = 50
Public Sub SetXY(i As Integer, j As Integer)
x = i
y = j
End Sub 'SetXY
Public Shared Sub ShowSum()
Dim sum As Integer = x + y
Console.WriteLine("The sum is {0}", sum)
End Sub 'ShowSum
End Structure 'MyStruct
Class MyClient
Public Shared Sub Main()
Dim ms As New MyStruct()
ms.SetXY(100, 200)
MyStruct.ShowSum()
End Sub 'Main
End Class 'MyClient
hey it's the C# forum not VB.NET! 
I figued it out anyways, thanks... I was declaring it as void thinking that its like the old C's void main
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Mar 3rd, 2004, 05:06 PM
#4
-
Mar 4th, 2004, 01:23 PM
#5
Code:
public struct MyStruct
{
private string _myVar;
public string MyVar
{
get { return _myVar; }
set { _myVar = value; }
}
public MyStruct(string myVarInit)
{
_myVar = myVarInit;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|