start new, end old, keep new

  • Thread starter Thread starter Guest
  • Start date Start date
Cor Ligthert,

Yes, you did...then I replied with:
Thanks for the answer.
(No way I would ever reference the VisualBasic libary)

then Herfried K. Wagner said:
Gladly the reference to "Microsoft.VisualBasic.dll" cannot be removed...
:-).

So I tell him that I replied to you, right?!

That's what happens when replies disapper or previous lines are being
removed.
The discussion is hard to follow then.

Your reply was:
To give it exact as you asked, set in C# a reference to the
Microsoft.VisualBasic Net runtime and than this code.

\\\\
Microsoft.VisualBasic.Interaction.Shell
("@C:\App2.exe",Microsoft.VisualBasic.AppWinStyle.NormalFocus,false,-1);
this.Close();
///

However better is it to take the last answer from Herfried, that you can
use in VBNet as well by the way.

\\\\
Imports System.Diagnostics
.
Process.Start("C:\foo.exe")
me.Close()
///

I hope this helps?

:-)

Cor
 
Pipo,
Yes, you did...then I replied with

That I did not.

Reread it, it is still beneath and look at "to give it exact as you asked"

I did not suggest to do that reference, you could use it when you wanted,
however I told you that I did not advised that to you in the same message.
See bellow. That can not be quoted by you as "he suggested"

Cor
 
Cor Ligthert,

Sorry, you're right!

Cor Ligthert said:
Pipo,


That I did not.

Reread it, it is still beneath and look at "to give it exact as you asked"

I did not suggest to do that reference, you could use it when you wanted,
however I told you that I did not advised that to you in the same message.
See bellow. That can not be quoted by you as "he suggested"

Cor
 
Pipo said:
I do believe that if you use the Visual Basic libary you are ' wanne be'
programming VB.NET, using the VB6 syntax.

Definitely no. This would mean you should not use 'If...Then...', 'Select
Case' and most of the other keywords any more only because they already
existed in VB6.
The equivalents?
if there aren't any make them yourself ...

LOL! If the tool already exists in prebuilt for and is neither deprecated
nor obsolete, why not use it? The methods in the 'Microsoft.VisualBasic'
namespace are tested heavily, your own "replacement" methods are not.
Rewriting the methods will take time and bring /absolutely no/ benefit.
appactivate = System.Windows.Form.Activate or api call
inputbox, IIF make them yourself....
ControlChars??

Why? "Microsoft.VisualBasic.dll" is referenced by default and the reference
cannot be removed. "Microsoft.VisualBasic.dll" is /part of/ Visual Basic
..NET.
Beep:
Console.WriteLine("\a"); // bell (for C# console)
OR
[DllImport("kernel32.dll")]
private static extern bool Beep(int freq, int dur);
Beep(3000, 200);

That's not the same. Sure, you can use p/invoke with 'MessageBeep' and
pass -1 as 'uType'. But that's unmanaged code, directly in your code.
etc, etc..
No need for the old library....I didnt say it was the EASIEST way....!

There is no "old" library.
 
Pipo said:
I do believe that the VisualStudio library is there for backwords
compatibilty
And to make the learing curve for VB6 programmers to VB.NET smaller.

Backwards compatibility is one of the best things because it preserves
assets. "Microsoft.VisualBasic.dll" is /not/ a compatibility library. The
compatibility libraries' names start with
"Microsoft.VisualBasic.Compatibility".
 
Herfried K. Wagner,

Do you mean you use msgbox also instead of messagebox.show?
Or on error goto ... and the errobject instead of try .. catch..??
DateAdd instead of DateTime.Add...?
etc. etc.???

So this piece of code is totally oke with you as VB.NET code?

private sub Foo
on error goto MyErr

if DateAdd("d",12,now) = Date then
msgbox "Yes"
else
msgbox "no"
end if
exit sub

MyError:
msgbox "Some error"

end sub

I would say that this is VB6 code, wich runs okey in VB.NET.
But that's just my oppinion...:-x
 
Pipo,

I am curious about your answer on my message about languages. To explain it
even more to you because Germanic can often give misunderstandings.

See words as
beef and ox

The first has its roots in the French language
The second has its roots in Germanic (not German) languages.

Cor
 
Cor Ligthert,

Well Cor to be honest I dont understand that whole languages thing you
mentioned, so...:-S

I dont understand the comparising of the subjects in relation about the
syntax of VB/VB.NET...
So that's why I cant say anything usefull about it.

Sorry..:-S
 
Pipo,

Pipo said:
Do you mean you use msgbox also instead of messagebox.show?

Yes, if 'MsgBox' provides everything you need. Why type more characters and
deal with the overload hell of 'MessageBox.Show' if you can do exactly the
same with shorter code?
Or on error goto ... and the errobject instead of try .. catch..??

'On Error GoTo' serves a different purpose than 'Try...Catch'. It's IMO a
typical a RAD feature that is useful if you are using VB.NET for quick
scripting.

Just my 2 Euro cents...
 
Herfried,
Yes, if 'MsgBox' provides everything you need. Why type more characters
and deal with the overload hell of 'MessageBox.Show' if you can do exactly
the same with shorter code?

It seems that my comparising with natural language is very difficult.

When you want to express yourself nice, you can say messagebox.show.
However MsgBox does the same.
'On Error GoTo' serves a different purpose than 'Try...Catch'. It's IMO a
typical a RAD feature that is useful if you are using VB.NET for quick
scripting.

A Try and Catch block makes the sentences more smooth.

However nowhere is said that you:
would have
should
must

Use that

Cor
 
If English (as language) would change as fast as VB, that would be strange.
Or all of a sudden we have a complete new language based on Russians and
English or so...???

And I my language we have words and sentences wich are totally (syntax)
correctly (nothing wrong with it)
but those words and sentences are, today, only spoken by very old people.
Those words and senteces where completely normal, at the beginning of the
previous century.
Nobody uses them now anymore.

I see that the same as with VB6/VB.NET, new language, new syntax, use the
new syntax and dont keep stuck in the old school sysntax.
With the only reason: it's still working, so why not..
In VB6 you can still write VB4 code, I dont agree with that either....
But again, that's my attitude.

????????????????who said this then, Cor?? Not me!!
However nowhere is said that you:
would have
should
must

Use that
 
I like to write .NET code.
So everything I'll write in VB.NET can be (relatively easy) be converted to
C#.
When I'll use IIF, msgbox, DateDiff, etc ect. this isnt the case anymore.
I work with VB.NET and C#, some of my colleges only know C# or C++, terms as
IFF or Function = Value doesnt say them anything!!!
That's why I dont use the VisualBasic namespace and to go back where this
all started, that's why I wanted to know the syntax without the namespace
VisualBasic being used.
 
Pipo,

You exactly wrote what I wanted to show. I am glad you understood it now.

:-)

Cor
 
Pipo,

That is the same for me, however where there are things in VBNet as CInt,
those I use.

For this in C# I can use (int) MyInteger, that is not in VBNet, when I
would avoid that I have to do DirectCast(MyInteger,Integer) a little bit
long is it not?

On the otherhand you don't know what functions C# will get from VB. Even the
French and German language has adopted (very few) words which never where in
French or German and came from English, although the puritans don't like it.

Cor
 
Cor,

So we agree.

No, I dont know, in the future, wich functions C# will get from VB.NET but
I'll see that then.
But I'll defenitly use them if they will become available in C# (or the
other way around).

Pipo.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top