BBC BASIC for Windows
« SORTLIB string sequence query »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:32pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: SORTLIB string sequence query  (Read 1082 times)
mavison
New Member
Image


member is offline

Avatar




PM


Posts: 14
xx SORTLIB string sequence query
« Thread started on: Mar 6th, 2010, 5:42pm »

I have recently started to use SORTLIB to sort arrays. In general it works very well, but the sort sequence for string arrays caught me out.

I was expecting the 'Normal' string sort (FN_sortinit(0,0)) sequence to be as ASCII codes, eg basically 0-9, A-Z, a-z.

However, this is not what happens. It seems that (because the library uses call "CompareString") the sequence is actually 0-9, aA-zZ.

It seems that CompareString is very clever, and is designed to compare words in whatever language is being used, and tries to get associated words together.

If Ignore Case is used (FN_sortinit(0,1)) then the lower and upper case letters are mixed up, so you can get aaAaAAa.

Please can I ask if:

(a) the help file can be changed to give an indication of what the sequences of 'Normal' and 'IgnoreCase' actually mean for strings? This clue would have saved me a lot of time!

(b) there is any means of sorting by straight ASCII code sequence? I suspect it would mean adding a simple string compare option to the assembler in SORTLIB, as I do not think the StringCompare API provides such a simple functon!

Martin
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: SORTLIB string sequence query
« Reply #1 on: Jun 27th, 2013, 10:21pm »

on Mar 6th, 2010, 5:42pm, mavison wrote:
there is any means of sorting by straight ASCII code sequence?

Version 1.3 of the SORTLIB library provides that option:

http://tech.groups.yahoo.com/group/bb4w/message/20560

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls