Top Resources Top Resources
Web Results
  • 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/Collating_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/collating-sequence
Questions/Answers
Write a Fortran program toconvert all uppercasecharacters in a user-suppliedcharacter string to lowercase.?
(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
knowledge base
* Indicates a required fieldAdd your knowledge or ask a question:
  • Display Name:(letters/numbers, no special characters)
  • Your knowledge or question:*
    (min: 100 characters, max: 2,000 characters)
  • Character count: 0
© 2009 ToseekA.com
Portions of this page powered by: yahoo!