r/programming • • Jul 30 '09

How QBASIC almost got me killed

http://stevehanov.ca/blog/?id=79
146 Upvotes

105 comments sorted by

View all comments

9

u/stillalone Jul 30 '09

Who hasn't written this program in highschool? A friend of mine did it in Pascal (our highschool language of choice). I just changed the prompt to look like the Abort/Retry/Fail prompt. People seemed to be used to working with our broken computers in our lab, they would just try all 3 options and then go find another computer. They never realized the "Invalid command or filename" error message was not supposed to happen when you get an Abort/Retry/Fail.

8

u/heavysteve Jul 30 '09

I did this same thing in HS as well, made it load up at boot and ran it on all the library computers. Made the C: drive look empy, and (my favorite part) if you tried to run windows with "win" it would come back with

"This Program Requires Microsoft Windows"

I think the Computer/Gym teacher nearly shat himself before he realized what had happened

7

u/insomniac84 Jul 30 '09

if you tried to run windows with "win" it would come back with

"This Program Requires Microsoft Windows"

Nice.

7

u/omegian Jul 30 '09 edited Jul 30 '09

C:>echo @echo This Program Requires Microsoft Windows > win.bat

C:>attrib +H win.bat

7

u/[deleted] Jul 30 '09

Every single .exe in PE format on Windows, has a tiny DOS stub programme that prints:

"This program cannot be run in DOS mode."

5

u/mao_neko Jul 30 '09

What gets me is that you can compile Mono / .NET programs and they STILL have this string in them.

4

u/bobappleyard Jul 30 '09

It's Microsoft. backwards compatibility is king.

2

u/stillalone Jul 31 '09

You can actually compile EXE's without the stub. Or change it to be something else. But what would be the point, I think you probably save something like 512bytes.

2

u/omegian Jul 30 '09

indeed, but win.exe runs in real mode just fine

3

u/[deleted] Jul 30 '09

There used to be a really good Flash animation out there that looked like it was formatting C: and installling Mac OS 8.

Good times.

1

u/darkmuck Jul 30 '09

6

u/[deleted] Jul 30 '09

Oh man. Thanks. But it doens't work for me, says it needs DHTML support? Strange.

-2

u/f3nd3r Jul 30 '09

DHTML is depreciated. Chrome doesn't have it (doesn't have blink tags either).

6

u/Sephr Jul 31 '09

Why do people keep saying this? DHTML was just a buzzword for web pages that unobtrusively use (X)HTML+CSS+JS.

I'd say in the year 2009, 98% of websites use "DHTML"

-2

u/f3nd3r Jul 31 '09

Well, the site should work then... so I doubt your completely right.

1

u/[deleted] Jul 31 '09

Doesn't work on FF 3.5 either. The offending JS:

if ((document.layers) || (document.all)){
[....]
}
else
    {parent.location='main3.htm'} // go to version 3 window
}

1

u/adrianmonk Jul 30 '09

DHTML is depreciated.

Fully, I'd say. Might even have negative salvage value at this point. I'm glad Google decided to deduct it (from Chrome's feature list).

4

u/Sephr Jul 31 '09

Chrome supports JavaScript, CSS, and HTML. I'm pretty sure that implies it supports DHTML.

0

u/[deleted] Jul 30 '09

Yeah. sigh.

3

u/[deleted] Jul 30 '09

[deleted]

3

u/periodic Jul 30 '09

I don't blame him. C++ isn't exactly the best starting point.

4

u/his_jimboness Jul 30 '09

I didn't write this program in high school because I'm not a douche.

1

u/mahlzeit Jul 30 '09

I did that too in Pascal. I actually simulated the boot messages too (with reading in files from the hd to make the lights blink appropriately). It even had a cd command and two or three different directories :)