The fact that the [WayBack] 31-character limit on ClientDataSet field and index names is worse, but I just encountered this GetParamNameWODog function in a Delphi 3rd party library:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function GetParamNameWODog(const ParamName: _string): _string; | |
| begin | |
| if (ParamName <> '') and (ParamName[1] = '@') then | |
| Result := Copy(ParamName, 2, 1000) | |
| else | |
| Result := ParamName; | |
| end; |
What’s wrong with using the Length function here?
Yes, SQL Parameter names will probably less than 1000 characters, but then the 1000 literal should be a constant with a meaningful name, and the '@' literal should be too. Read the rest of this entry »





