On Sat, 7 Apr 2012 23:49:42 -0300 Marcos Douglas <m...@delfire.net> wrote:
> Hi, > > Using FPC 2.6.1 and Laz trunk on Windows, there is a better way to not to > do such codes below? > > Examples > 1- I'm on the LCL and I have an Edit (edtFileName): > var > lFileName: string; > lStrings: TStrings; > begin > lStrings := TStrings.Create; > try > lFileName := Utf8ToSys(edtFileName.Text); > lStrings.SaveToFile(lFileName); > finally > lStrings.Free; > end; > end; > > 2- If I want to add the path delimiter using an Edit (edtPath) > var > lPath: string; > begin > lPath := > SysToUtf8(IncludeTrailingPathDelimiter(Utf8ToSys(edtPath.Directory))); The path delimiter is the same in all system encodings. lPath :=IncludeTrailingPathDelimiter(edtPath.Directory); > edtPath.Directory := lPath; > end; Mattias -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus