Best way to find if a string is in a list (without generics)

You could use AnsiIndexText(const AnsiString AText, const array of string AValues):integer or MatchStr(const AText: string; const AValues: array of string): Boolean; (Both from StrUtils unit) Something like: Result := (AnsiIndexText(‘Hi’,[‘Hello’,’Hi’,’Foo’,’Bar’]) > -1); or Result := MatchStr(‘Hi’, [‘foo’, ‘Bar’]); AnsiIndexText returns the 0-offset index of the first string it finds in AValues that matches AText case-insensitively. … Read more

Why does CreateProcess give error 193 (%1 is not a valid Win32 app)

The most likely explanations for that error are: The file you are attempting to load is not an executable file. CreateProcess requires you to provide an executable file. If you wish to be able to open any file with its associated application then you need ShellExecute rather than CreateProcess. There is a problem loading one … Read more

Published interface properties bug and workarounds

To summarize, the problem happens only with published interface properties that have a getter method, and the property points to component on another form/module (and that form/module is not recreated yet). In such case restoring form DFM causes an AV. I’m pretty sure the bug is in the ASM code in GetOrdProp, but it’s beyond … Read more

Delphi 2006-2010 error: “Cannot create file C:\Users\Admin\AppData\Local\Temp\EditorLineEnds.ttr”

There are three solutions to this that I am aware of: Try uninstalling the Windows security update KB2982791 which was already mentioned by Francisco Caffagni. This solved the issue for me (Windows 8.1 + Delphi 2007) but it might not be such a good idea to uninstall a Windows security update. Rename the file every … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)