Visual Basic needs more credit
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
What about that can't be done in C#? :confused:
You'll never get very far if all you do is follow instructions.
-
What about that can't be done in C#? :confused:
You'll never get very far if all you do is follow instructions.
With operator
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
Colborne_Greg wrote:
that no other language can do
Pretty bold statement, given it's followed by a code block that could easily be converted to C#. ;P
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
I would make sure you have your flame proof pants on..
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
What about that can't be done in C#? :confused:
You'll never get very far if all you do is follow instructions.
I suspect he's talking about the With block. Of course, as the With statement was introduced to fix a defect in VB in the first place...
-
Colborne_Greg wrote:
that no other language can do
Pretty bold statement, given it's followed by a code block that could easily be converted to C#. ;P
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
no with operator in C#
-
With operator
Just because you don't need the extra keyword doesn't mean that C# can't do it:
new Image
{
Height = 150,
Width = 150,
Source = RotateStream
(
Pictures.Album[AlbumName].Picture,
Pictures.Album[AlbumName].Angle
)
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
no with operator in C#
See my answer to your other post - you don't need the
With
operator in C# for object or collection initializers.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I suspect he's talking about the With block. Of course, as the With statement was introduced to fix a defect in VB in the first place...
its not a with block, "new image with"
-
no with operator in C#
As well there shouldn't be. C# doesn't need it.
You'll never get very far if all you do is follow instructions.
-
its not a with block, "new image with"
and you can do the same in C# without the need for "with" keyword
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
no with operator in C#
Colborne_Greg wrote:
fortunately, no with operator in C#
FTFY
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
its not a with block, "new image with"
Colborne_Greg wrote:
its not a with block
It's an object initializer, which is fully supported in C#, without needing an extra keyword. http://msdn.microsoft.com/en-us/library/bb384062.aspx[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
its not a with block, "new image with"
So, the same as Auto-initialisation in C# then.
new Image{ Height = 150, Width= 150 }
-
no with operator in C#
I have to say, you walked right into that one.
-
I think that Visual Basic should be shown off for its beauty and elegance. Here is a sample of what it can do - that no other language can do:
Private Sub AlbumListPopulate()
Try
AlbumsList.ItemsSource = New List(Of Image)For Each AlbumName In Pictures.Albums Try AlbumsList.ItemsSource.Add \_ ( New Image With { .Height = 150, .Width = 150, .Source = RotateStream \_ ( Pictures.Album(AlbumName).Picture, Pictures.Album(AlbumName).Angle ) } ) Catch End Try Next Catch End Try
End Sub
-
That code doesn't fail
-
I have to say, you walked right into that one.
No better way to learn. I was told that C# and visual basic are the same language but I can find things in Visual Basic that are not in C# and things in C# that are not in Visual Basic