• (cs) in reply to PstScrpt

    It is true of VBScript in Classic ASP, though.  But then VBScript doesn't have "As Integer".

  • (cs) in reply to DWalker59
    DWalker59:
    For the people who commented "How could this possibly compile", um, VB is not a compiled language. The IDE generally tells you when you do something bad, but the programs are not "compiled" in the traditional sense.  When you try to run a program, mismatched or unclosed If/Then/Else statements will give you a warning, though.
     
    Return is used with Gosub, which is left over from WAY old versions of VB.  So there IS a Return statement.

    It's like 1985 all over again. Too bad this hasn't been true since the early 90's (for MS) or late 80's (for Borland).

    My god, imagine if you unzipped your VB shareware programs and found a bunch of .bas, .frm, and .res files, and had to buy VB to run them. The horror! It really would be a blast from the past. =D
  • (cs) in reply to foxyshadis

    Actually, there is some truth in what David claims, if I recall correctly.

    Isn't VB like Java 'compiled' to bytecode which is then run by the VB runtime? That way it isn't 'really' compiled, just tokenised or something...

    Drak

  • (cs) in reply to Drak

    Drak:
    Isn't VB like Java 'compiled' to bytecode which is then run by the VB runtime? That way it isn't 'really' compiled, just tokenised or something...

    Aargg.....

    Java, VB.Net (and every other .Net language) are actually really-truly compiled, down to an actual really-truly machine code.  It's not the machine code that native to the machine it's run on (or any machine actual produced on silicon) but it not merely "tokenized" by any strech of the word.

    Also, before it's run, Java (usually) and VB.Net (always) is recompiled into native machine code for the machine it run on.

  • (cs) in reply to lucio
    lucio:

    Mike R:

    I suspect some people on this forum are not following the proper quoting procedure, which is why you see a lot of raw HTML.

    Not true, it's all about the user-agent [:P]

    In IE, I can quote perfectly, but using Opera lots of raw HTML shows up for some reason.

    User-agent: Opera

  • (cs) in reply to lucio
    lucio:

    Mike R:

    I suspect some people on this forum are not following the proper quoting procedure, which is why you see a lot of raw HTML.

    Not true, it's all about the user-agent [:P]

    In IE, I can quote perfectly, but using Opera lots of raw HTML shows up for some reason.

    User-agent now stating IE

  • (cs) in reply to foxyshadis

    FoxyShadis: "You mean, I'm sure, that's EXACTLY how C and all its babies do. Okay, Java gets nitpicky, but the vast majority of the C standard libary returns 1 or -1 on success, 0 on failure, and if you ever cast a logical comparison to an integer and output it, it'll be -1 or 0. (or 2^(8*x)-1)"

    If you ever cast a logical expression to an integer in C or C++, and it comes out as anything but 0 or 1, then throw your compiler away, because it's so basically broken in that area that you can't possibly trust any code coming out of it.

  • (cs) in reply to loneprogrammer
    loneprogrammer:
    Mike R:
    I suspect some people on this forum are not following the proper quoting procedure, which is why you see a lot of raw HTML.

    No.  I have followed the same procedure using Firefox 1.0 and Mozilla 1.0, and the raw HTML resulted from using the older browser.  And it looked right in the preview screen!


    Don't use the preview screen. :)
  • (cs) in reply to dhromed
    dhromed:
    loneprogrammer:
    Mike R:
    I suspect some people on this forum are not following the proper quoting procedure, which is why you see a lot of raw HTML.

    No.  I have followed the same procedure using Firefox 1.0 and Mozilla 1.0, and the raw HTML resulted from using the older browser.  And it looked right in the preview screen!


    Don't use the preview screen. :)


    Previewing your post is rather important.. in addition to that you should also check the HTML design, assuming you have that option when you're posting.  A lot of the time, the HTML tags get replaced with coded versions of the character which causes all the tags to show up...
  • (cs) in reply to JThelen

    Oh, and for the record..

    1. Edit post doesn't work.  I didn't get 15 seconds to do anything.. [:^)]

    2. I use Firefox, and haven't had a single problem quoting posts, writing in links, or any of the things that other folks do..
  • (cs) in reply to JamesCurran
    JamesCurran:

    Drak:
    Isn't VB like Java 'compiled' to bytecode which is then run by the VB runtime? That way it isn't 'really' compiled, just tokenised or something...

    Aargg.....

    Java, VB.Net (and every other .Net language) are actually really-truly compiled, down to an actual really-truly machine code.  It's not the machine code that native to the machine it's run on (or any machine actual produced on silicon) but it not merely "tokenized" by any strech of the word.

    Also, before it's run, Java (usually) and VB.Net (always) is recompiled into native machine code for the machine it run on.



    Thank you James.  I too, tear out my hair everytime I hear something like "Java isn't compiled".  :-)
  • (cs) in reply to tiro
    tiro:
    JamesCurran:
    Java, VB.Net (and every other .Net language) are actually really-truly compiled, down to an actual really-truly machine code.  It's not the machine code that native to the machine it's run on (or any machine actual produced on silicon) but it not merely "tokenized" by any strech of the word.

    Also, before it's run, Java (usually) and VB.Net (always) is recompiled into native machine code for the machine it run on.



    Thank you James.  I too, tear out my hair everytime I hear something like "Java isn't compiled".  :-)


    Heck, I think most modern "interpreters" compile down to at least some sort of intermediate representation.  Perl does this, so do many scheme and lisp implementations.  And those languages with lots of silly parenthesis are considered the epitome of interpreted languages.

  • (cs) in reply to foxyshadis

    Re True = -1:

    foxyshadis:
    AJR:
    It's not what C and all its babies do, but it's not really a WTF.

    You mean, I'm sure, that's EXACTLY how C and all its babies do. Okay, Java gets nitpicky, but the vast majority of the C standard libary returns 1 or -1 on success, 0 on failure, and if you ever cast a logical comparison to an integer and output it, it'll be -1 or 0. (or 2^(8*x)-1)

    Of course, the wtf of a few random functions reversing the success/failure values shall go unranted, for now.


    No, it isn't what C does.  The C boolean operators all accept any non-zero value as true, and return only 1 or 0 for true or false.  If you cast a logical comparison to an integer and get anything other than 1 or 0, your compiler is broken.  I suggest you ask for your money back.

    Your point about the ad hockery of return values of library functions is well taken, though.
  • (cs) in reply to JamesCurran
    "Java, VB.Net (and every other .Net language) are actually really-truly compiled".  Yes, but VB6 is not really-truly "compiled"; I think the IDE makes an IL.  My original comment was for the people saying "How could this possibly compile", sounding as if there was a user compile step that would error out.  That's not the case with VB6.  When VB.Net does its background parsing, it highlights the errors and gives messages in the ToDo or Tasks (whatever it's called) part of the IDE.
     
    In VB.Net, you have to Build the project before you run it.  In VB6, you can run the project without building or compiling it. 
  • wtf (unregistered) in reply to Jon Limjap

    On Error Goto 0 'or else you really never get any errors

    He could com ref the VBScript.lib or whatever the exact name is and then execute it

  • Sergey (unregistered) in reply to RayS

     Any problems caused? Yes.

    If "get list of files" fails wat wewill loop through ?

    Now, why do we need next 6 try? Do you really wont to delete file if <FONT face="Courier New">copy file </FONT>will fail ? If not

    try (get list of files
    loop through files
        try (log some file attributes
          log some more attributes
          log permissions
          copy file
          delete file)
    end loop<FONT face="Courier New">)</FONT>

  • AC (unregistered) in reply to Ryan Anderson
    Anonymous:
    John Bigboote:
    Most languages just give you enough rope to hang yourself.

    VB without Option Strict allows you to implicitly convert everyday household objects into EVEN MORE rope.


    I thought the philosophy of Unix was to give admins enough rope to shoot themselves.

    You can use rope to shoot yourself - wow, I'd like to see that :D

  • you dontwantoknow (unregistered) in reply to Jon Limjap

    no offence guys, but vb aint a real language anyway ;) ,,, hence most vb programs are probably rank with that sort of badness.... you know, from lack of real language skills ;)

  • (cs) in reply to A Wizard A True Star
    A Wizard A True Star:

    Of course, it should have occurred to whoever took out the Exec that this function was no longer doing anything. Still, the variable naming is an even bigger WTF. Somewhere in that app, there's a set of global variables declared like:

    Dim sqlConnection1

    Dim sqlConnection2

    Dim sqlConnection3

    Dim sqlConnection4

    Dim sqlConnection5

    Dim sqlConnection6

    ...

    Dim sqlConnection255

    ...

    Yeah. We really need to see some more of this code.

    Par for the course would be:

    <FONT color=#0000ff>Global</FONT> X <FONT color=#0000ff>As Single</FONT>
    <FONT color=#000000>Public Function GetConnectionFromPool() As Integer
      On Error Resume Next
      Dim ReturnStatus As Integer
    </FONT>  ReturnStatus = "Dim sqlConnection" & CStr(X) & " <FONT style="BACKGROUND-COLOR: #ffffff" color=#a9a9a9>as SqlConnection</FONT>"<FONT color=#000000>
      X = X + 1
      If ReturnStatus <> 0 Then
        Return False
      End If
    

    Return True Exit Function End Function</FONT>

     

Leave a comment on “Drowning in the Connection Pool”

Log In or post as a guest

Replying to comment #:

« Return to Article