Cursed Code.

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
Manpcnin
Posts: 46
Joined: Feb 25, 2007 1:43
Location: N.Z.

Cursed Code.

Post by Manpcnin »

So today I found out that you can "pass" a single quote to a #macro parameter and prepend it to macro lines with ## to conditionally exclude them from the macro. (#if doesn't seem to work in macros)

Code: Select all

#macro mymacro(p1,COND)
    callalways(p1)
    COND##callSometimes(p1) 'cursed
#endmacro
mymacro(x,)'cursed
mymacro(y,')'super cursed
Leading to the most cursed piece of code I have yet written, which I will spare you by not posting in full.
But I'm curious. What is the most cursed code you have written?
Provoni
Posts: 513
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Cursed Code.

Post by Provoni »

It happened to me once, with a large project for me at that time. A vague bug came about and I had no clue what changed. I was tired also and a couple of weeks after I did a rewrite from scratch.

And then, perhaps various multi-threading issues when conditional stuff inside loops just would not update.
Post Reply