Topic awaiting preservation: Visual Basic - Conditions (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: :morF |
posted 08-06-2005 08:20
I know from my experiences in programming using PHP that i can do conditional statements like this one: code: $connection = @mysql_connect($host, $user, $pass) or die('Error in connecting to mySQL server');
|
Bipolar (III) Inmate From: Australia |
posted 08-06-2005 10:14
I have done a bit of vb, but it was a while back and i used to treat it "dumb" basically doing more complicated things manually - i.e you would need some if statements etc. |
Paranoid (IV) Inmate From: INFRONT OF MY PC |
posted 08-08-2005 14:43
try this one |
Nervous Wreck (II) Inmate From: |
posted 08-08-2005 15:10
The "try catch" syntax is valid in Java, .net (C#) or c++, not in vb. In VB, you have the beautiful "On Error Resume Next" |
Paranoid (IV) Inmate From: INFRONT OF MY PC |
posted 08-08-2005 16:13
no i think the try cath syntax is valid since vb.net .. but i may be mistaken there |
Bipolar (III) Inmate From: Australia |
posted 08-08-2005 16:21
Yes you are correct blacknight, vb.net is substantially different - you also need a different mindset to the old VB since now its OOP... code: Sub DoSomething() Try 'Do Something Catch e as Exception 'Catch the error and display it. Response.Write ("An Error Occurred: " & e.toString()) Finally 'Do the final cleanup such as closing the Database connection End Try End Sub |
Bipolar (III) Inmate From: Australia |
posted 08-08-2005 16:26
Oh vb.net still supports On Error etc, for compatibilty purposes - but you shouldnt use them for new stuff obviously... |
Maniac (V) Mad Scientist From: :morF |
posted 08-09-2005 00:13
Good thing I only have VB6.0 then, I guess. I can't afford the .NET Visual Studio just yet, so... thanks guys, this should help. |
Bipolar (III) Inmate From: Australia |
posted 08-09-2005 05:45
Man get visual basic .net standard - i picked it up for $180 AUD retail version. You don't need visual studio to be able to do everything and for stuff that is done out of the box with VS there are workarounds for Standard. |
Bipolar (III) Inmate From: Australia |
posted 08-09-2005 05:50
Its quite annoying to be honest, they dont have an in-between version. I dont want visual c++, visual J etc but i do want to be able to make class files etc... |