× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I think it's because of the fact that it should be:
-7, -4, -2, 0, 1, 4, 6

not
-2, -4, -7, 0, 1, 4, 6

The sort is saying that -2 is less than -7 and that -7 is less than 0. 
Doesn't make any sense to me...

Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
709-576-8132
rpower@xxxxxxxxxx
http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. - 
Sir Winston Churchill




"Booth Martin" <booth@xxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
2005/10/18 03:01 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: Sorting an array w/multiple fields






Isn't the field sorted correctly, with the negative numbers first, in
ascending order?



I am unclear about the sorta statement.  I sort an array that is in a data
structure, and it seemed to me to work unfailingly.



The code is here:



http://www.martinvt.com/Code_Samples/SFL_Sort/sfl_sort.html



 As you can see from the image, the sorta works, both ascending and
descending.



(This is my clickable subfile, where the columns are sorted based on the
heading being mouse-clicked.)

 

---------------------------------

Booth Martin

http://www.martinvt.com

---------------------------------

-------Original Message-------

 

From: RPG programming on the AS400 / iSeries

Date: 10/18/05 10:59:34

To: RPG programming on the AS400 / iSeries

Subject: Re: Sorting an array w/multiple fields

 

 

> I have the program written & using Sorta the results are not what I 
would

> have expected.  It sorts them -2, -4, -7, 0, 1, 4, 6   OK not sure why

> that is, but it does sort to some degree.

 

That's interesting.  It looks like it's sorting it as an unsigned binary

integer.  Can we see a snippet that shows how you sorted this?  I'm just

curious. AFIAK, you can't use SORTA to sort an array of data structures,

but you did, somehow... I'm just curious how you made this work...

 

--

This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list

To post a message email: RPG400-L@xxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit: http://lists.midrange.com/mailman/listinfo/rpg400-l

or email: RPG400-L-request@xxxxxxxxxxxx

Before posting, please take a moment to review the archives

at http://archive.midrange.com/rpg400-l.

 

.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.