UDTs (as was vb6)

  • Thread starter Thread starter StrandElectric
  • Start date Start date
Thankyou thankyou thankyou! I'm getting the UDT er... I mean *structure*
working! But, wierd that necessity for a line continuation character..
 
| > I love to code and I love to do Web design, but given
| > the way things are going, I might just take up watercolors
| > or gardening instead.
|
| Actually, I've been playing quite a bit with XNA for windows and wp7
| (and yes, I actually have one of the devices - and yes, I love it) -
| and I have to say, it's actually quite fun. Your missing out a bit, I
| think...
|

If you say so. Good luck in your endeavors. Maybe
you can invent an especially tasty raspberry hybrid
on Windows Live Farmville and make a fortune from
the 60+ million people who think it's "fun" to spend
hours playing like children with interactive cartoons.
That sounds like an appropriate use for .Net. :)
 
|
| But VB for Net is than not anymore alone for creating TV dinners.
|

Neither is VB. But both are designed for that market.

|
| The difference with VB6 is, that VB Net is not only mainly positioned for
| the Windows Desktop environment, but for everything which is now available
| for the current Windows OS environment.
|

It's interesting how the salespitch changes. It used
to be that MS made the absurd claim that .Net -- a Java
clone composed largely of superfluous wrappers -- was
the most appropriate tool for Windows development.
Now that everyone's crazed with the cloud fad and
cellphone "app" mania, .Net is being positioned for
a more realistic purpose: To compete with Java and others
in another Microsoft bid to take over an emerging market
by introducing a new cross-platform tool that's not
cross-platform.
 
Mayayana explained :
Neither is VB. But both are designed for that market.


It's interesting how the salespitch changes. It used
to be that MS made the absurd claim that .Net -- a Java
clone composed largely of superfluous wrappers -- was
the most appropriate tool for Windows development.
Now that everyone's crazed with the cloud fad and
cellphone "app" mania, .Net is being positioned for
a more realistic purpose: To compete with Java and others
in another Microsoft bid to take over an emerging market
by introducing a new cross-platform tool that's not
cross-platform.

LOL... .NET has been cross platfrom for a long time, in the os sense.
There are at least 2 opensource implementations, mono being the most
commonly used - and it runs on FreeBSD, MacOSX, Windows, and Linux.
And yes, Mono is very usable and there are several popular Linux
desktop apps written using it.

..NET it's self is cros platform in the architecure sense - there has
long been a arm based version (compact framework on windows mobile) -
and now the runtime on windows phone 7. It supports 32 and 64 bit
intel architectures... The XBox360 is a powerpc architecture - works
there.

Sorry, VB6 doesn't run on some of those :(
 
I understand how line continuation chracters work, but I though that in this
case this was compulsory where they were. I will experiment. And can I
really get 2010Express free? What are the advantages?
 
No problem there. But what are the *advantages* ?

1. * New *
2. * Shinier *

What more could you want?

Oh, ok, actual reasons... no more need for line-continuation
characters (but watch out for where you need a blank line to tell it
you've finished a statement), multi-line lambdas, WPF code window so
you can change the font size with a mouse wheel, and * more *!

"What's New in Visual Basic 2010":
http://msdn.microsoft.com/en-us/library/we86c8x2.aspx
 
Am 07.01.2011 15:03, schrieb StrandElectric:
No problem there. But what are the *advantages* ?

Shall I repeat what's in the link?

VB:
- Auto-Implemented Properties
- Collection Initializers
- Implicit Line Continuation
- Multiline Lambda Expressions and Subroutines
- New Command-Line Option for Specifying a Language Version
- Type Equivalence Support
- Covariance and Contravariance

IDE:
- Navigate To
- Highlighting References
- Generate From Usage
- IntelliSense Suggestion Mode

I don't know what you consider an advantage.

You can target Framework 4.0 now, I think.
 
Nothing what you currently need, but as soon as you start with properties be
very glad of it exist.


"Armin Zingler" wrote in message
Am 07.01.2011 15:03, schrieb StrandElectric:
No problem there. But what are the *advantages* ?

Shall I repeat what's in the link?

VB:
- Auto-Implemented Properties
- Collection Initializers
- Implicit Line Continuation
- Multiline Lambda Expressions and Subroutines
- New Command-Line Option for Specifying a Language Version
- Type Equivalence Support
- Covariance and Contravariance

IDE:
- Navigate To
- Highlighting References
- Generate From Usage
- IntelliSense Suggestion Mode

I don't know what you consider an advantage.

You can target Framework 4.0 now, I think.
 
Mayayana,

Do you know what it takes to create TV dinners (we have them here of course
as well, but I was not aware of that used name for that).

Much more than serving oysters, but because that C++ programmers sometimes
serve oysters some of them think that it is a more elite job.

For an oyster I need only a special knife, to know were to put it, and then
to turn that around.

:-)

Cor

"Mayayana" wrote in message
|
| But VB for Net is than not anymore alone for creating TV dinners.
|

Neither is VB. But both are designed for that market.

|
| The difference with VB6 is, that VB Net is not only mainly positioned for
| the Windows Desktop environment, but for everything which is now available
| for the current Windows OS environment.
|

It's interesting how the salespitch changes. It used
to be that MS made the absurd claim that .Net -- a Java
clone composed largely of superfluous wrappers -- was
the most appropriate tool for Windows development.
Now that everyone's crazed with the cloud fad and
cellphone "app" mania, .Net is being positioned for
a more realistic purpose: To compete with Java and others
in another Microsoft bid to take over an emerging market
by introducing a new cross-platform tool that's not
cross-platform.
 
OK Andrew. Thanks for that. Now I am working with the free Visual Basic
Express 2008 which I downloaded form MS. I understand a free download is
available for 2010, again Express. Obviously 'Express' must be crippled in
some way. In what way, I'd like to know!

No problem there. But what are the *advantages* ?

1. * New *
2. * Shinier *

What more could you want?

Oh, ok, actual reasons... no more need for line-continuation
characters (but watch out for where you need a blank line to tell it
you've finished a statement), multi-line lambdas, WPF code window so
you can change the font size with a mouse wheel, and * more *!

"What's New in Visual Basic 2010":
http://msdn.microsoft.com/en-us/library/we86c8x2.aspx
 
MS made F2 point to Object Browser, just like in VB6. It's the quickest way
to learn the .Net framework, and what to call to do the same thing that you
were doing in VB6.

In VB.Net, "all" project files use ".vb" extension. The first few lines tell
you if it's for a Module/Form/Class, etc. It maybe confusing to see "Public
Class Form1", because it says it's a class, but that is true even for VB6.
In VB6, Form, Class, UserControl were called Object Modules, while ".BAS"
files were called Standard Modules. Standard Modules still exist in VB.Net,
but some; even in VB6 don't recommend their use if you can put the code in a
Class. Classes help divide your code into manageable components that don't
interfere with each other, and each is responsible for the functionality it
manages.

If you use standard modules, then at some point you find that you need to
turn some variables into global variables so they can be accessed by the
other modules, but this would introduce data integrity problems, or variable
integrity as I call it. Imagine that you have a group of related variables,
like an array, and a counter variable, or flags that must be set or checked
in a UDT before using other variables in the UDT. If you use standard
modules, you might find yourself that you are checking the related variables
everywhere you are accessing them, and you would introduce bugs if you
forgot once to check them somewhere, perhaps when you come back to the
program after doing something else for a year, and you added more code and
forgot that checking a flag is needed. Putting the checking in one routine
and calling it from everywhere helps, but you will still find that any
routine can call any other routine, or accessing any variable is an
invitation to bugs, which is called "Spaghetti". Putting things in classes
helps insuring that the integrity of the variables or data is maintained.
Plus you could reuse routine names, for example, you can have
oStudent.Search(), and oTeacher.Search(), which makes your code easier to
read.

As for "Namespace", it's a concept or keyword that at least was introduced
in C++ in the 1990's. It's basically used by the compiler to collect the
symbols and putting them in a basket with a certain name on it so the names
collected don't interfere with what another coder is writing. If you have
multiple developers, they can use DevA, DevB, etc. namespaces so if they use
the same names, there is no conflict.

If the name space you want is too long, like "Windows.Forms...", etc., you
can use "Imports" statement to allow the names in that namespace to be used
without the namespace-name as an explicit qualifier. For example:

Before:

Windows.Forms.MessageBox.Show(...) ' Somewhere in the file

After:

Imports Windows.Forms ' At the beginning of the file

MessageBox.Show(...) ' Somewhere in the file

This allows you to use anything in "Windows.Forms", and your line is
certainly shorter. However, in some cases there could be something in that
namespace that conflicts with something you are declaring(and you get
compilation errors). In that case, you can use an alias for that name space,
so you just type the alias, not the whole name. For example:

Imports WF=Windows.Forms ' At the beginning of the file

WF.MessageBox.Show(...) ' Somewhere in the file

Imports Statement
http://msdn.microsoft.com/en-us/library/7f38zh8x.aspx

In C++/C#, they use "using" keyword to accomplish the same effect.
 
Back
Top