Forum > General

A unit i made... Called FFU[updated]

(1/2) > >>

captian jaster:
i wanted to share with you guys a unit. its Called FFU. its a simple unit that makes some Folders and file procedures Simpler. I plan on adding more feature but its Pretty simple right now.
A list of Procedure Of Functions Are:

--- Code: ---Function GetFileAttr(const FilePath:String):LongInt;
Procedure RemoveFile(const FilePath:String);
Function ReadFile(var FileVar:TextFile):String;
Procedure CheckDir(const PathName:String);
Procedure CheckFile(const FilePath:String);
Procedure CreateFile(var FileVar:TextFile; const InFile:String);
Procedure EditFile(var FileVar:TextFile; const InFile: String);

--- End code ---
A text file is included in the package to teach you guys how to work the unit... C/C would be nice and if you have any other codes you would like me to(or try to) simplify(Theres a word for it!) Ill get on it.
No, its not open sourced but you may use it in your other programs.
as long as it points credits to Adam N.Andujar..... Hope you like it!
[UPDATE!]
 Its been updated to 1.35. now you can return file Attributes and i added a RemoveFile. ill work on updating the Help,About file with more examples later..
And the FFU.pas file has been added so thnx guys...
And Bart.... Oh.... didnt think there. ive been trying to add something else to it for awhile but i see it having use somewhere down the lane.
Version 1.35:
http://www.megaupload.com/?d=MHBUQYHX

marcov:
Note that distribution .o/.ppu's is next to useless. It will only work guaranteed with exactly one FPC version for exactly one target (namely the same one)

captian jaster:

--- Code: --- Uses
FFU
--- End code ---
wouldnt work?

Bart:

--- Code: ---  CheckDir('EPIC');
  IF(DirFound = True) Then ...

--- End code ---

In what way would that be easier than


--- Code: ---  if DirectoryExists('EPIC') then...

--- End code ---

Bart

Bart:

--- Quote from: captian jaster on April 17, 2010, 09:56:13 pm ---
--- Code: --- Uses
FFU
--- End code ---
wouldnt work?

--- End quote ---

Yes, but (as marcov explained) only if the user was actually using exactly the same version of the fpc compiler.
And since the compiler changes version quit often, the provided .ppu will become useless (unless you provide .ppu's for each and every fpc version (and even then, users that have fpc from svn will not be able to use it).

So, if you think we might actually like your unit and want to use it, you'ld better publish the source code instead (you may still copyright the code).

Anyhow, it's nice to see you starting to write your own set of re-usable code.

Happy coding.

Bart

Navigation

[0] Message Index

[#] Next page

Go to full version