- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
<FONT face=Arial size=2>
</FONT><FONT face=Arial color=#ff0000 size=2> * RobIII fires up VB6 and writes some code...</FONT>
<FONT face=Arial><FONT size=2><FONT color=#ff0000> * RobIII hits F5 (Run)....</FONT> <FONT size=5>*BANG*</FONT> -> Runtime Error 13: Type Mismatch.</FONT></FONT>
<FONT face=Arial size=2>It DOES blow up... [|-)]</FONT>
Admin
Given once again that this is a scripting engine, His calling function could easily return that to the User. (Which would be the correct thing to do for a mis-typed script)
Admin
>You guys are morons, this is a part of a scripting engine.
I assume the original post was a joke.
If not -- I'd expect a scripting engine to take a string and work with that.
Admin
It does take a string. this is a SUBROUTINE. Ever hear of them? Do you expect a scripting engine to work all in one SUB?
Admin
Sometimes, there can be legitimate uses for things like this, although not exactly. The whole argument management is stupid, but the basic concept has its applications in some environments.
I have found myself doing this with Microsoft FoxPro 2.6 (for Windows 3.x), where you could not write that much code in button and control definitions and were forced to call separate funcions instead.
Now, having a separate function for each button in your application is sick. Imagine, for example, all the navigation buttons in your customer form, calling functions cliFirst(), cliPrev(), cliNext(), cliLast(), cliSearch(), cliAdd(), cliDel(), cliEdit(), cliDetails, and so on. But that's only the beginning, because you have also a form for vendors, and then new functions vndFirst(), vndPrev(), vndNext(), vndLast(), vndSearch(), vndAdd(), vndDel(), vndEdit() and vndDetails() are born.
Since all client navigation and editing functions share some code and set the same status flags on and off, and the same occurs with vendor functions, I resorted to define one big function for each form, namely cli() and vnd(), which you would call this way: cli("EDIT"), vnd("DELETE"), and so on.
Every WTF in this world has its uses...
Admin
In fairness, they did. The manpage for socketcall says "User programs should call the appropriate functions by their usual names. Only standard library implementors and kernel hackers need to know about socketcall." and it is implemented as a switch which calls the appropriate function just as if the user had called it directly. The question, then, is why does that function exist, and the best (i.e. only) answer I can find in the Linux Kernel Mailing List archives is "historical reasons", in 1999. Ahh, ain't cruft great [:)]
Admin
"Maybe us morons and lamers have heard of Eval before ?"
Would you be the same morons that think VB has an Eval function ?
Admin
It WILL throw an error. If you try to convert a String into a integer with CInt() and there is text in it, it will throw a System.IvalidCastException error stating that Cast from string "blah" to type Integer is not valid.
dim myStr as String = "Blah"
dim i as Int32
i = CInt(myStr) 'will throw a System.InvalidCastException
Admin
(Grumbles... Fixes Error Should be a System.InvalidCastException.) Alex, can we edit our posts Pleeeeease??????
Admin
Try looking up the Microsoft Scripting Control before calling people morons.
Admin
HAHAHA! You truly are moronic
Why would one use Microsoft Scripting control when writing a scripting engine?
That like saying you are gonna build a boat, but start out with the USS Iwo Jima.
Admin
"HAHAHA! You truly are moronic
Why would one use Microsoft Scripting control when writing a scripting engine?
That like saying you are gonna build a boat, but start out with the USS Iwo Jima."
Couldnt have said it better myself.
And there are perfectly valid reasons for making your own script engine over using the script control.
Admin
I was replying to the statement "people who think there is an Eval function in VB are morons". I never said Eval was useful in the context of this particular WTF. But, if you feel like twisting my words around to prove you're the only non-moron here, have a ball.
Admin
There is no way to Eval VB Code.
Admin
WTF language are you using where CInt returns a 0 for non-numeric strings?
Admin
he was probably thinking of the "Val" function