![]() Topic awaiting preservation: Visual Basic - Conditions (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: :morF |
![]() 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 |
![]() 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 |
![]() try this one |
Nervous Wreck (II) Inmate From: |
![]() 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 |
![]() no i think the try cath syntax is valid since vb.net .. but i may be mistaken there |
Bipolar (III) Inmate From: Australia |
![]() 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 |
![]() 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 |
![]() 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 |
![]() 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 |
![]() 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... |