Hooray Array!



  • I have had a bad day, and would like to share my pain.

    I have been cleaning a visual basic program that has a cumulative total for forms, modules, class modules, references and components exceeding 200.

    This is the latest gem.

    qPrint.Document.CreateColumns 24, "tbItem", True, "Arial", 8, eLeft, 0, 0, ccrMiddleRow, 0
    ' to-do: appologize in advanced to next coder
    ' very sorry lol
    qPrint.Document.InsertRow "tbItem", "", False, Sp(0), Sp(1), Sp(2), Sp(3), (val(Sp(1)) + val(Sp(2)) + val(Sp(3))), Sp(5) & Sp(4), Sp(7) & Sp(6), Sp(9) & Sp(8), Sp(11) & Sp(10), Sp(13) & Sp(12), (val(Sp(5)) + val(Sp(7)) + val(Sp(9)) + val(Sp(11)) + val(Sp(13))) & (val(Sp(4)) + val(Sp(6)) + val(Sp(8)) + val(Sp(10)) + val(Sp(12))), (val(Sp(1)) + val(Sp(2)) + val(Sp(3))) + (val(Sp(4)) + val(Sp(6)) + val(Sp(8)) + val(Sp(10)) + val(Sp(12))), Sp(0), Sp(1), Sp(2), Sp(3), (val(Sp(1)) + val(Sp(2)) + val(Sp(3))), Sp(5) & Sp(4), Sp(7) & Sp(6), Sp(9) & Sp(8), Sp(11) & Sp(10), Sp(13) & Sp(12), (val(Sp(5)) + val(Sp(7)) + val(Sp(9)) + val(Sp(11)) + val(Sp(13))) & (val(Sp(4)) + val(Sp(6)) + val(Sp(8)) + val(Sp(10)) + val(Sp(12))), (val(Sp(1)) + val(Sp(2)) + val(Sp(3))) + (val(Sp(4)) + val(Sp(6)) + val(Sp(8)) + val(Sp(10)) + val(Sp(12)))



  • well, at least you got an apology...



  • Dynamic creation of documents... thing, that I've never seen done in a nice way without some graphical generator. I also can't think of any way to do it properly 😞

    Variable names can of course be called better, but anyway, it's always a horrible spaghetti code. You just have to list all those values and print all this text somewhere...



  • qPrint is an entity of a virtual print driver.. and that line of code only appends one record the the printed recordset. sp is merely an array, which would be fine if it wasn't such a mess. and also note; the values from the array originate from algorithms performed on a multi-dimentional array. yeah, beer was good last night.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.