PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Reading directories and store the result in a data file
Reading directories and store the result in a data file
Started by Volker Gericke, Dec., 04 2023 12:06 PM - 2 replies
Posted on December, 04 2023 - 12:06 PM
Hi,

I am absolutely new to Windev (I just ordered it and wait for the delivery) - coming from Clarion which I use since 1990.

My question: I am creating a picture database. The pictures are organized in a fixed structure like this
Category1
Shooting Type1
Set Number1
File1
File2

Set Number2
File1
File2

Shooting Type2
..

The file should contain fields for Category, Shooting Type, Set number and File.

I want to read the structure recursively and write a record for each picture found. Also I want to watch the database for any changes in the directories.

Any ideas?

Kind regards,

Volker
Posted on February, 22 2024 - 7:46 PM
Hi Volker,

We have been on Clarion since the DOS days and are now working with Windev. There is a significant learning curve in a lot of ways. I find myself constantly doing Google searches like "WINDEV list files in directory". These kind of searches normally bring up a bunch of links in the Windev online help. From there they have a lot of links to other parts of their documentation.

There are several file and directory functions that will let you read and traverse the directory structure. You will want to look at fListFile() and fListDir(). It should just be a matter of traversing your directory structure, retrieving the path to get your Category, Shooting, Set info and adding a record to a table.

It's not trivial but should be pretty straight forward.

Hope that helps.

Jim
Posted on February, 24 2024 - 7:23 PM
Hi Jim,

I found this solution already. It is much easier than using Clarions DIRECTORY(). What I am really missing is a funtion like
If NOT DUPLICATE()
Add(file)
END

I removed every unique key in my files to avoid those annoying duplicate errors in Windev. It is a directory-reading program, so I can delete the whole database before reading the directories but of course this is time wasting.

My feelings between Clarion and Windev is mixed. The database handling in Clarion is great but the controls in Windev are amazing. If Clarion 12 would have similar possibilities I would continue with Clarion.

Thank you!

Kind greetings

Volker