Date Function on Mac lazarus / 8-Other ---------------------------------------------------------------------- IndianaJones · 2008-03-20 23:33 Hi all, Anyone has experience with the date function on mac os x, or is there any other function for getting gate info. the following code produce nothing;         DeCodeDate ( Date , YY , MM, DD ) ; Thanks ---------------------------------------------------------------------- IndianaJones · 2008-03-22 15:28 Hi All, I solved the case in a different way; Function MacDate:String; var    AProcess: TProcess;    AString: TStringList; begin    AProcess := TProcess.Create(nil);    AString := TStringList.Create;    AProcess.CommandLine := 'date';    AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];    AProcess.Execute;    AString.LoadFromStream(AProcess.Output);    AString.Delimiter:=' ';    AString.DelimitedText:=AString.ValueFromIndex[0];    MacDate:=AString[2]+' '+AString[1]+' '+Astring[5];    AString.Free;    AProcess.Free; end; ---------------------------------------------------------------------- Phil · 2008-03-22 17:11 Quote from: "IndianaJones"Hi all, Anyone has experience with the date function on mac os x, or is there any other function for getting gate info. the following code produce nothing;         DeCodeDate ( Date , YY , MM, DD ) ; Thanks This code works fine on OS X with FPC 2.2.0: uses   SysUtils; var   ADate  : TDateTime;   AYear  : Word;   AMonth : Word;   ADay   : Word; begin   ADate := EncodeDate(2008, 3, 22);   DecodeDate(ADate, AYear, AMonth, ADay);   WriteLn(AYear, '/', AMonth, '/', ADay); end. Let me know if this doesn't work. If it does, then you're probably doing something not quite right in your own code. Thanks. -Phil ---------------------------------------------------------------------- IndianaJones · 2008-03-22 18:18 Phil the exact problem is "date" function, it is running for Mac OS X? So decode is the wrong example. I just want to get the system date. ---------------------------------------------------------------------- Phil · 2008-03-22 18:24 Quote from: "IndianaJones"Phil the exact problem is "date" function, it is running for Mac OS X? So decode is the wrong example. I just want to get the system date. Making this substitution to my sample code also works fine on my Mac: //  ADate := EncodeDate(2008, 3, 22);   ADate := Date; Thanks. -Phil ---------------------------------------------------------------------- IndianaJones · 2008-03-22 19:38 Hi Phil, Yes you are right. date function is running, encode and decode also, Anyway i have another question, is there any fpc configuration file. When I quit from the lazarus and open again, the linker option disappear. I enter this linker option '-dylib_file' '/System/Library/Frameworks/OpenGL.framework/Versions/A/ Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Vers ions/A/Libraries/libGL.dylib' Thanks. ---------------------------------------------------------------------- Phil · 2008-03-22 20:31 Quote from: "IndianaJones"Anyway i have another question, is there any fpc configuration file. When I quit from the lazarus and open again, the linker option disappear. I enter this linker option '-dylib_file' '/System/Library/Frameworks/OpenGL.framework/Versions/A/ Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Vers ions/A/Libraries/libGL.dylib' I don't have Leopard so I haven't had to use this workaround for the dependency on OpenGL that was recently added to the Carbon widgetset. There is an fpc.cfg file. On Windows it's in the same folder as the FPC compiler and other .exe files, but on Mac I had to search for it. On my Mac fpc.cfg is in /private/etc - I never would have thought to look for it there, but that's what we get for using Unix tools. Thanks. -Phil ---------------------------------------------------------------------- IndianaJones · 2008-03-22 21:34 Thanks Phil for the quick reply. Anyway I compiled the openglscene but cant see the components on the Lazarus IDE. I appreciate for the info. Yep there is a config file in /private/etc/fpc.cfg And there is a row about the linking section, i'll try this.