Re: [fpc-pascal] uses in '' relative paths

2020-10-07 Thread Ryan Joseph via fpc-pascal
> On Oct 7, 2020, at 11:02 AM, Mattias Gaertner via fpc-pascal > wrote: > > Only in FPC: > > {$unitpath sources} > interface > uses > TOMLParser, TOMLTypes; Some interesting stuff here, thanks. Almost there but for some reason Scanner.pas is not found even though it's in the same directory

Re: [fpc-pascal] uses in '' relative paths

2020-10-07 Thread Mattias Gaertner via fpc-pascal
On Wed, 7 Oct 2020 10:53:16 -0600 Ryan Joseph via fpc-pascal wrote: > I'm trying "uses in" which I never knew existed before. > > The idea is that I provide a path to TOML.pas using -Fu then use the > "in" syntax to reference the units which are in a subdirectory. This > makes it safe from the p

[fpc-pascal] uses in '' relative paths

2020-10-07 Thread Ryan Joseph via fpc-pascal
I'm trying "uses in" which I never knew existed before. The idea is that I provide a path to TOML.pas using -Fu then use the "in" syntax to reference the units which are in a subdirectory. This makes it safe from the project importing the unit so any private units in the subdirectory don't over

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-07 Thread Ryan Joseph via fpc-pascal
Here's another interesting option I considered. You can call Scandir which returns a record with an enumerator. You can then use this to drop right into the for loop. It doesn't allocate memory and you can break the loop to stop the iteration. The benefit is you can avoid costly memory allocatio

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-07 Thread Ryan Joseph via fpc-pascal
> On Oct 7, 2020, at 2:19 AM, Michael Van Canneyt via fpc-pascal > wrote: > > I see Delphi has something similar, so I will add an implementation. But I > need to study the options they provide so we can make a reasonably > compatible version :) Excellent thanks. It looks like Lazarus has Fi

Re: [fpc-pascal] Adding file to string to the RTL

2020-10-07 Thread Michael Van Canneyt via fpc-pascal
On Tue, 6 Oct 2020, Ryan Joseph via fpc-pascal wrote: Since we're on the topic how about another one-liner for reading all the files in directory into a dynamic array? This has the added benefit of getting enumeration for free. This is standard stuff for working with files in scripting lang