Defaultstring Function ? lazarus / 21-General ---------------------------------------------------------------------- jamie · 2021-03-27 16:11 Is there a Defaultstring function in the LIBS somewhere ? DefStr would be just fine.. I have implemented an inline for that because I can't seem to find a predefined one which I would rather use to reduce code bloat. ---------------------------------------------------------------------- PascalDragon · 2021-03-27 16:35 What do you mean with “Defaultstring”? What do you expect it to do? ---------------------------------------------------------------------- jamie · 2021-03-27 17:04 Quote from: PascalDragon on March 27, 2021, 05:35:24 pmWhat do you mean with “Defaultstring”? What do you expect it to do?  I would of thought the name would be revealing..  Its a way to enforce a string to return something other then nil or empty..  SomeStringStorageEntity := Defaultstring(SomeUNknownStringCOntent, 'This is a default string results if input string is empty'); it can be shorten up but languages out there support this as a convenient way to reduce source code clutter to ensure no empty strings in cases where it can't happen. Classes like the TiniFile have such functions if keys don't exist .. This could be an inline..