Recent

Author Topic: A unit i made... Called FFU[updated]  (Read 5617 times)

captian jaster

  • Guest
A unit i made... Called FFU[updated]
« on: April 17, 2010, 07:39:19 pm »
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: [Select]
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);
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
« Last Edit: April 17, 2010, 11:42:44 pm by captian jaster »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10937
  • FPC developer.
Re: A unit i made... Called FFU
« Reply #1 on: April 17, 2010, 08:06:01 pm »
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

  • Guest
Re: A unit i made... Called FFU
« Reply #2 on: April 17, 2010, 09:56:13 pm »
Code: [Select]
Uses
FFU
wouldnt work?

Bart

  • Hero Member
  • *****
  • Posts: 5074
    • Bart en Mariska's Webstek
Re: A unit i made... Called FFU
« Reply #3 on: April 17, 2010, 09:59:12 pm »
Code: [Select]
  CheckDir('EPIC');
  IF(DirFound = True) Then ...

In what way would that be easier than

Code: [Select]
  if DirectoryExists('EPIC') then...

Bart

Bart

  • Hero Member
  • *****
  • Posts: 5074
    • Bart en Mariska's Webstek
Re: A unit i made... Called FFU
« Reply #4 on: April 17, 2010, 10:08:03 pm »
Code: [Select]
Uses
FFU
wouldnt work?

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

captian jaster

  • Guest
Re: A unit i made... Called FFU
« Reply #5 on: April 17, 2010, 10:55:56 pm »
Ok.. ill make a a new bundle including the source after i fix a few things.

captian jaster

  • Guest
Re: A unit i made... Called FFU[updated]
« Reply #6 on: April 21, 2010, 08:52:41 pm »
[Updated!]
Now Version 2.24

Heres the whole Procedure\Function list.
Code: [Select]
Function EditFileName(const OFileName:String; NFileName:String):Boolean;
Function DirInUse:String;
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);
Read the About/Help for how to use and more info...
Any C/C would be nice :)
DL now attached.

 

TinyPortal © 2005-2018