Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Sorting an Array Post Reply Post New Topic
Author Message
ajmufic
Newbie
Newbie


Joined: 28 Aug 2008
Online Status: Offline
Posts: 20
Quote ajmufic Replybullet Topic: Sorting an Array
    Posted: 15 Apr 2010 at 4:36am
Is there an easy (or hard) way to sort an Array in Crystal Syntax?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 16 Apr 2010 at 4:35am
probably any sort algorithm you want, but there are limits to the arrays, only 1d.  Can use loops and swap values to sort.
 
something like this should swap:
 
if arr[x]<arr[y] then (
  temp := arr[y];
  arr[y] := arr[x];
  arr[x] := temp;
);
 
 
look up loops, and you will probably want a flag that a swap has occurred, so when none are performed, you know that you are done.
 
HTH
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 16 Apr 2010 at 4:43am
Bubble sort probably would work.  I haven't done one in a few years (okay, a lot of years).
IP IP Logged
joelum
Newbie
Newbie


Joined: 11 Nov 2010
Location: United States
Online Status: Offline
Posts: 1
Quote joelum Replybullet Posted: 11 Nov 2010 at 10:11am
See my PPT presentations using bubble sort algorithm at http://www.sfarea.org/12201.html
 
For arrays under 445 rows, see Nov 2008 meeting (easy)
 
For arrays from 1 to 1000 rows due to 99,999 loop limitations,
see Oct 2010 meeting (hard but rigorous)


Edited by joelum - 11 Nov 2010 at 11:02am
joelum
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.