...A common example is the familiar "alphabetic order", in which "Alfred" occurs before "Zeus" because "A" occurs before "Z" in the English alphabet. But there are other issues that a collating sequence must consider, say in a computer system. Read full entry
This entry is from Wikipedia,the leading user-contributed encyclopedia.It may not have been reviewed by professional editors(See full disclaimer)


- 1.Collating sequence - Wikipedia, the free encyclopedia
- Collating sequence. From Wikipedia, the free encyclopedia. The term collating sequence refers to the order in which character strings should be placed when sorting ...
- http://en.wikipedia.org/wiki/C
ollating_sequence
- 2.collating sequence: Definition from Answers.com
- collating sequence ( ′kä′lādiŋ ′sēkwəns ) ( computer science ) The ordering of a set of items such that sets in that assigned order can be
- http://www.answers.com/topic/c
ollating-sequence
![]() |
Write a Fortran program to (continue...)without changing
the uppercase and
nonalphabetic characters in
the string. Assume that your
computer uses the ASCII
collating sequence. You can
assume that the user-supplied
character string contains no
more than 20 characters.
|
|
![]() |
I assume your question should read "without changing the LOWERCASE and nonalphabetic", otherwise not much would be changed. Well, here is essentially the most optimized routine that I ever wrote doing just that (actually, the original had the capability of also converting lower case to upper case, using a toggle; but that is not part of your request, so I removed the redundant code from the source) SUBROUTINE cascvt(strng,lngt) C CASe ConVerTer C subroutine to convert all upper case to lower case C strng: input and output string C lngt: number of characters in the string to convert INTEGER lngt,i CHARACTER*20 strng INTEGER jgap jgap=ICHAR('a')-ICHAR('A') C this could be replaced by jgap=32, since the ASCII code for "a" is C 97 and for "A" is 65, using the ICHAR function ensures robustness C in case other systems are used (like EBCDIC--hey I'm an old timer) IF(lngt.GT.0) THEN C if string is empty, nothing needs to be changed DO 20 i=1,lngt IF(strng(i:i).LE.'Z') THEN IF(strng(i:i).GE.'A') strng(i:i)=CHAR(ICHAR(strng(i: i))+jgap) ENDIF 20 CONTINUE ENDIF RETURN END |
|
* Indicates a required fieldAdd your knowledge or ask a question:




