Re: [fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Jonas Maebe
On 05 Feb 2009, at 08:54, Ken G. Brown wrote: How can I find the directory path to the executable of the currently executing program from within the program? Or alternately, how can I specify the relative path to a file that is located in the same folder as the application bundle for my

Re: [fpc-pascal] dynamic arrays: copy-on-write or not?

2009-02-05 Thread Jonas Maebe
On 05 Feb 2009, at 05:55, David Emerson wrote: Dynamic arrays are reference counted: assignment of one dynamic array-type variable to another will let both variables point to the same array. Contrary to ansistrings, an assignment to an element of one array will be reflected in the other:

Re: [fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Ken G. Brown
Thx for the quick response! I think I'm almost there. I seem to have a bundlePath : CFURLRef; but I don't quite know what to do with it. How do I convert it to something I can use in a Reset() to open a file? Thx, Ken G. Brown At 10:29 AM +0100 2/5/09, Jonas Maebe apparently wrote: On 05 Feb

Re: [fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Jonas Maebe
On 05 Feb 2009, at 17:03, Ken G. Brown wrote: Thx for the quick response! I think I'm almost there. I seem to have a bundlePath : CFURLRef; but I don't quite know what to do with it. How do I convert it to something I can use in a Reset() to open a file? If you enter CFURLRef in the

Re: [fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Ken G. Brown
Whew! Thx! I was part way through all that but wasn't sure what I could pass to reset(); Digging through it now. I haven't dealt with this stuff before. Ken At 6:24 PM +0100 2/5/09, Jonas Maebe apparently wrote: On 05 Feb 2009, at 17:03, Ken G. Brown wrote: Thx for the quick response! I think

Re: [fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Jonas Maebe
On 05 Feb 2009, at 21:29, Ken G. Brown wrote: So far I have the following external definitions: All external definitions you need are already in the MacOSAll unit shipped with FPC. Function CFStringGetFileSystemRepresentation(myPathString : CFStringRef; buffer : ppchar; maxBufLen :

Re: [fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Ken G. Brown
At 9:51 PM +0100 2/5/09, Jonas Maebe apparently wrote: On 05 Feb 2009, at 21:29, Ken G. Brown wrote: So far I have the following external definitions: All external definitions you need are already in the MacOSAll unit shipped with FPC. Function CFStringGetFileSystemRepresentation(myPathString

[fpc-pascal] Re: specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Paul Nicholls
Ken G. Brown kbrown-ee4meeah...@public.gmane.org wrote in message news:p06240407c5b049e88...@[10.0.1.199]... MacOS X, 10.5.6, fpc 2.2.2 How can I find the directory path to the executable of the currently executing program from within the program? Or alternately, how can I specify the

Re: [fpc-pascal] Re: specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Jonas Maebe
On 05 Feb 2009, at 23:00, Jonas Maebe wrote: On 05 Feb 2009, at 22:52, Paul Nicholls wrote: Maybe I haven't understood you completely, but have you tried this? MyProgramFolder := ExtractFilePath(ParamStr(0)); This should hopefully get you the folder of the currently running program from

Re: [fpc-pascal] specifying the relative path to a file that is located in the same folder as the application bundle?

2009-02-05 Thread Ken G. Brown
Thanks a bunch for all the help! My legacy OS 9 app is now upgraded to OS X and working! It put up a hell of a fight but with all your help, the obstacles have been overcome. Awesome! Ken G. Brown At 9:51 PM +0100 2/5/09, Jonas Maebe apparently wrote: You have to allocate memory for it.