Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 1,170 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Read data out of folder #299702
11/26/09 08:31
11/26/09 08:31
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Hey guys,

been a while since I asked for help here tongue
But this question I looked for in the manual, but couldn't find anything related...

I wanna read out specific filetype files from a folder, is there a way to store all filenames of them in an array?
(maybe just every file in the folder, then i can seperate out all the specific's I want myself by looking at it's extension).

anyone know's how to, or could write me some code/DLL?

thanks!


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Read data out of folder [Re: Helghast] #299707
11/26/09 08:57
11/26/09 08:57
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
C'mon man...

Check the manual...

txt_for_dir( TEXT*,STRING* name)

:b


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Read data out of folder [Re: EvilSOB] #299717
11/26/09 10:39
11/26/09 10:39
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
HAHAHHAHAAAA, oh, i'm so ashamed xD
I kept on looking for "folder" and "file", but never looked for this...
thanks for pointing that out ^__^

Sometimes you just need a push in the right position, and I couldnt imagine this wouldnt be supported already...

thanks again laugh


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Read data out of folder [Re: Helghast] #299719
11/26/09 10:50
11/26/09 10:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
No problems dude. Happens to the best of us...

even me... grin


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Read data out of folder [Re: EvilSOB] #299790
11/27/09 04:10
11/27/09 04:10
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline
Newbie
Sepiantum  Offline
Newbie
S

Joined: Nov 2009
Posts: 34
FILE* file = fopen("c:\\file.txt","r"/*Open params*/);

int data;

fscanf(file,"%d",&data);

fclose(file);

Hope that helps.
use "r" for reading, use "w" for writing, use "a" for appending at the end of file. Although you need to use fprintf instead of fscanf.

Re: Read data out of folder [Re: Sepiantum] #299804
11/27/09 08:22
11/27/09 08:22
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
thanks, though i already figured it out using txt_for_dir.
thanks nonetheless laugh

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Read data out of folder [Re: Helghast] #299805
11/27/09 08:29
11/27/09 08:29
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Keep Sepiantum's suggestion in mind though Helghast.
txt_for_dir is missing some capabilities.

I think it is incapable of listing sub-folders or something like that.
It ONLY will list files, and those files MUST have some extension.
Or something like that....

Damn my long-term memory.



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Read data out of folder [Re: EvilSOB] #299812
11/27/09 09:28
11/27/09 09:28
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: EvilSOB
Keep Sepiantum's suggestion in mind though Helghast.
txt_for_dir is missing some capabilities.

I think it is incapable of listing sub-folders or something like that.
It ONLY will list files, and those files MUST have some extension.
Or something like that....

Damn my long-term memory.


That's fine, all i really want is to read .bmp files out of a single folder (nothing nested or whatever in there).
It's good for future reference, I agree, who knows i might need it later anyway laugh

for now i can load all the strings, and read it out and load them bmp's using pstring, that's all I wanted ^_^

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1