Announcement

Collapse
No announcement yet.

Alphabetizing prints

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Don Schullian
    replied
    Hi Ron,

    You'll have to send the records in the correct order yourself.
    You can:
    1) sort the records in the file,
    2) read all the records into an array then sort them
    3) or you can load just that portion of the record you want to
    sort on into an array (along with the record number), sort
    and print.

    The following code is off the top of my head and just an example.

    Code:
    TYPE RecordIndexTYPE
      SortData AS STRING * 20
      RecNo    AS LONG
    END TYPE
    
    DIM tIdx(LastRecord) AS RecordIndexTYPE
    
    FOR RecNo = 1 TO LastRecord
      GET #FileNo, RecNo, tRecord
      tIdx(RecNo).SortData = tRecord.Names
      tIdx(RecNo).RecNo    = RecNo
    NEXT
    
    ARRAY SORT tIdx()
    
    FOR RecNo = 1 TO LastRecord
      GET #FileNo, tIdx(RecNo).RecNo, tRecord
      PrintMyData tRecord
    NEXT

    ------------------
    C'ya
    d83

    Leave a comment:


  • Ron Shaw
    started a topic Alphabetizing prints

    Alphabetizing prints

    How can I get a random access file to send data to a printer
    in alphabetical order?

    Thank you for your time.



    ------------------
    mailto:[email protected][email protected]</A>
Working...
X