Previous Thread
Next Thread
Print Thread
Rate Thread
#102158 02/07/2001 5:37 PM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
I'm writing a script for myself tipsy

I'm using this code in a sub. This code prints 53 times (because there are 53 file to open). But how can I sort the code alphabetically? for example I have

a.cgi
b.cgi
c.cgi
d.cgi

to open and want to sort them alphabetically with the $isim variable
if b.cgi has $isim beginning with letter "a" print it first, then other and other... HOW?

Code
code:

[ February 07, 2001: Message edited by: jeologic ]

Sponsored Links
#102159 02/07/2001 8:13 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
$isim is the first bit of data in each record, so no need to do anything special.

Just add the 'sort' command to your foreach

foreach $i (sort @data) {

etc

Of course, I could be misunderstanding what you're asking. If so, please provide more detail.

--mark


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#102160 02/07/2001 9:07 PM
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
*cough*
He's asking for things to be printed in ABC(c) order.

#102161 02/07/2001 9:19 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
And what did I answer? Perhaps we need more explanation/clarification of what's what.


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#102162 02/07/2001 9:22 PM
Joined: Feb 2000
Posts: 4,625
Member
Member
Offline
Joined: Feb 2000
Posts: 4,625
No, i was just confirming what you heard.

Sponsored Links
#102163 02/08/2001 9:06 AM
Joined: May 2000
Posts: 1,356
Addict
Addict
Joined: May 2000
Posts: 1,356
Code
quote:</font><HR> $isim is the first bit of data in each record, so no need to do anything special.
Just add the 'sort' command to your foreach
foreach $i (sort @data) {
etc <HR></BLOCKQUOTE>


I tried to put sort command into foreach bu it didnt work
it still prints randomly... well some of them sorting but not all of them. I didnt find the solution...

btw, $isim includes non-english characters in some files. But only one of them has a non-english character as the first letter... can that be a prob?

here is the complete sub;

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, Arial">code:

[ February 08, 2001: Message edited by: jeologic ]


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)