The STRVEC module

The STRVEC module is concerned lists of fixed size strings. This illustrates basic conversions and sorting.

Code

program run_strvec

   use TYPES
   use SYSTEM
   use STRVEC
   use TEXTFILE

#  include "macros"

   implicit none

   STRVEC* :: s 

   tonto.initialize
   stdout.create_stdout
   stdout.open
  
   s.create( ["hello  ", "how    ", "are    ", "you    ", "finding", &
              "TONTO  ", "?      ", "hello  ", "?      ", "?      "] )

   stdout.flush
   stdout.text("Here is a vector of strings:")
   stdout.flush
   stdout.put(s,"column")

   stdout.flush
   stdout.text("Here are the same strings sorted in alpabetical order.")
   stdout.text("In fortran, all capitals come before lower cases!")
   stdout.flush
   s.sort
   stdout.put(s,"column")

   stdout.flush
   stdout.text("Here are the same strings in upper case:")
   stdout.flush
   s.to_upper_case
   stdout.put(s,"column")

   stdout.flush
   stdout.text("Now I remove all repetitions:")
   stdout.flush
   s.remove_repetitions
   stdout.put(s,"column")

end 

Results

Here is a vector of strings:

        1               hello
        2                 how
        3                 are
        4                 you
        5             finding
        6               TONTO
        7                   ?
        8               hello
        9                   ?
       10                   ?

Here are the same strings sorted in alpabetical order.
In fortran, all capitals come before lower cases!

        1                   ?
        2                   ?
        3                   ?
        4               TONTO
        5                 are
        6             finding
        7               hello
        8               hello
        9                 how
       10                 you

Here are the same strings in upper case:

        1                   ?
        2                   ?
        3                   ?
        4               TONTO
        5                 ARE
        6             FINDING
        7               HELLO
        8               HELLO
        9                 HOW
       10                 YOU

Now I remove all repetitions:

        1                   ?
        2               TONTO
        3                 ARE
        4             FINDING
        5               HELLO
        6                 HOW
        7                 YOU