Link to home
Start Free TrialLog in
Avatar of getajob20
getajob20Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Formless Application which needs to sort a TStrings variable

I have written myself a wallpaper randomisation application, and this application currently uses a form with a TListBox component on it to sort the files alphabetically. I want to remove the form so it is quicker and smaller, but then I have the problem of sorting the filenames. How can I sort the contents of a TStrings variable, without using a form component?

The application doesnt take any user input, which is why I want it formless.
ASKER CERTIFIED SOLUTION
Avatar of svvada
svvada

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of epaulson
epaulson

TStringList has a Sorted property
hello getajob20, you can do code in your Program, .DPR file and have a TstringList and many other things, but if you do NOT have a window and a GetMessage Loop then you will have trouble keeping your program running, or do you need it to keep running?, If file size is your concern then you can do a API window and GetMessage loop Program, if not then just Hide your main form. Do you need code for an API window and GetMessage Loop program?
Avatar of getajob20

ASKER

Slick182: The program closes as soon as it has changed the wallpaper.

Everyone else: I'll try that and report back as soon as I have tried it. I'll award points to swada if it works, as you were the first to respond. If not, i'll let you know
It wasn't a particularly in-depth solution to a general problem, so I awarded a C grade. If the problem warranted a more in-depth answer, and I was given the depth of answer I needed, I would increase the grade.