Reply to post:

This is why copy'n'paste should be banned from developers' IDEs



QUERY1 = 'SELECT .... blah blah blah':

QUERY2 = 'SELECT .... blah blah blah':

// etc

function GetQueryText(aQueryName: String): String;


sQueryName: String;


sQueryName := Uppercase(aQueryName);

if sQueryName = 'QUERY1' then

GetQueryText := QUERY1

else if sQueryName = 'QUERY2' then

GetQueryText := QUERY2

else if sQueryName = 'QUERY3' then

GetQueryText := QUERY3

else if ....

etc etc


And there were dozens and dozens of constants that this runtime constant lookup function helped resolve.

Give. Me. Strength.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019