Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Function to read files from a directory? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: March 23 2008 at 17:33 | IP Logged Quote onhiatus

I thought this should be easy, but I can't figure it out. I'd like to write a macro that reads all the files from a directory.

Any thoughts on how this can be done?

Thanks, Tony
Back to Top View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: March 23 2008 at 21:54 | IP Logged Quote TonyNo

Ya know, I've never needed to do something like this, but I think you may only be able do this via a script.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
krommetje
Super User
Super User
Avatar

Joined: December 29 2004
Location: Netherlands
Online Status: Offline
Posts: 695
Posted: March 24 2008 at 03:47 | IP Logged Quote krommetje

USe the DOS Dir command and redirect the output to a text file. use ph_readfile(.. to read the textfile.

like this e.g:

Dir c:\ > dirc.txt

and then have ph_readfile( .. to read the text and store it in a TEMP or a GV or use similar code TONYNO made for the weathermacro...

Peter

Back to Top View krommetje's Profile Search for other posts by krommetje Visit krommetje's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: March 24 2008 at 07:21 | IP Logged Quote TonyNo

OK, there is that way.   
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
onhiatus
Senior Member
Senior Member
Avatar

Joined: May 12 2004
Location: United States
Online Status: Offline
Posts: 279
Posted: March 24 2008 at 12:41 | IP Logged Quote onhiatus

That's what I'd come up with. It seemed like there should be some native PH support, maybe I'll get around to writting a plug in some day...

Thanks, Tony
Back to Top View onhiatus's Profile Search for other posts by onhiatus Visit onhiatus's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum