Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

[SOLVED]Desending sort

Integrated Application Platform › Forums › General › [SOLVED]Desending sort

  • This topic has 2 replies, 2 voices, and was last updated 8 years, 5 months ago by jaska_lee.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • August 27, 2014 at 8:16 am #784
    jaska_lee
    Participant

    I need to retrieve a set of records in a table sorted by a date field, but from the latest backwards. Can I use descending sorting in suneido instead of default ascending?

    I read a thread posted back in 2001 on this forum saying that descending sorting was not implemented and it was suggested to use query.Prev. Could anybody post a piece of sample code for query.Prev method?

    thanks a lot

    August 27, 2014 at 4:08 pm #1083
    amckinlay
    Keymaster

    You can sort reverse. e.g. stdlib sort reverse name (look in the help under Database > Queries > sort)

    Note: you can only reverse the entire sort. If you are sorting by multiple fields you can’t reverse just one of them.

    To read in reverse order, you can do something like:

    WithQuery(query)
    {|q|
    while false isnt x = q.Prev()
    ...
    }
    August 28, 2014 at 1:13 am #1084
    jaska_lee
    Participant

    Hi Andrew, That worked, thanks a lot for your help!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language