Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 15 MAR 2000 10:18:19PM Rick Todd wrote:

I have been unable to get the RLIST command to work. I'm attempting to sort a list of keys. The below code works ok, doesn't sort, if I rem the RLIST line. Does anyone have any suggestions? Thanks Rick.

DECLARE SUBROUTINE MAKE.LIST, RLIST

SONG_NUMBER=XLATE("PREFORMER",1,"SONG_NUMBER","X")

CONVERT @VM TO @FM IN SONG_NUMBER

MAKE.LIST(0,SONG_NUMBER,"","")

RLIST("SELECT SONG BY TITLE",5,"","","")

SCOUNT=0

EOF=START"

LOOP

 READNEXT @ID USING 0 BY AT ELSE EOF=END"

WHILE EOF NE "END"

 JUKEBOX=XLATE("SONG",@ID,"JUKEBOX","X")
 IF JUKEBOX=Yes" THEN 
    SCOUNT+=1    
    WRITEV @ID TO FILE.VAR1,"JUKEBOX",SCOUNT+15 THEN NULL
 END   

REPEAT


At 16 MAR 2000 01:12AM Donald Bakke wrote:

Rick,

If all you are trying to do is sort your keys then just use V119. However, based on your RList statement it appears as if you really want to sort by another field (i.e. TITLE). The RList statement looks fine to me. How is TITLE justified? Is it indexed? Is there any change in the order of the keys after the RList statement?

Also, I'm sure you only provided a partial code list because I don't see the OPEN statement for FILE.VAR1.

[email protected]

SRP Computer Solutions


At 16 MAR 2000 03:51PM Rick Todd wrote:

1. What is V119?

2. Title is a field in the song table. I do what to sort this list of keys by the title field.

3. The title field is left justified.

4. In the song table the title field has a cross reference index on it.

5. You are correct this is just a segment of the total code. Though from the "SONG_NUMBER=XLATE("PREFORMER",1,"SONG_NUMBER","X")" line to the "REPEAT" line it is an exact duplicate.


At 17 MAR 2000 01:57AM Donald Bakke wrote:

Rick,

1. What is V119?

This is a very fast routine for sorting elements within a string. However, since you are not sorting the keys by their values but by another field this won't help you.

2. Title is a field in the song table. I do what to sort this list of keys by the title field.

Okay.

3. The title field is left justified.

Okay.

4. In the song table the title field has a cross reference index on it.

Is this index working okay?

5. You are correct this is just a segment of the total code. Though from the "SONG_NUMBER=XLATE("PREFORMER",1,"SONG_NUMBER","X")" line to the "REPEAT" line it is an exact duplicate.

Does the order of the keys change at all then after the RList? I'm sure you have already checked this out, but is there any pattern to the key's order? My guess is that there is something wrong with the field you are sorting by, although AFAIK a cross-reference index shouldn't cause this problem. However, to eliminate any doubt, I might remove the index and test this again.

[email protected]

SRP Computer Solutions


At 22 MAR 2000 03:20PM Rick Todd wrote:

I have realized the my problem and it had little to do with the code but with how the keys are stored in the SYSLISTS table. When I used the RLIST command that sorted the SONG table by the TITLE field it stored the selected keys like this format;

4523 1

4524 1

4522 1

4521 1

"key #":@VM":"sorted field #"

Which meant that in my READNEXT LOOP the @ID really did not represent an actual table record key. Prior to extracting the information from the table, I needed to "CONVERT @VM TO @FM IN @ID" and use the @ID.

This simple line solved my problem. Thanks Rick.


At 22 MAR 2000 03:40PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

[notag]or

ReadNext Id, WhichValue

[<A HREF="http://www.sprezzatura.com" onMouseOver="window.status='Click here to visit our web site?';return(true)">The Sprezzatura Group</A>]

[<I>World Leaders in all things RevSoft</I>]

[<img src="http://www.sprezzatura.com/zz.gif">]

[<script language="javascript">function openNewPage () {window.location.href=(document.TOCNavigator.pageToGoTo.options[document.TOCNavigator.pageToGoTo.selectedIndex].value);document.TOCNavigator.pageToGoTo.selectedIndex="0";}end hiding from non-JS browsers –></script>] [<FORM ACTION "" METHOD=GET NAME="TOCNavigator" <SELECT NAME="pageToGoTo" SIZE=1 onChange="openNewPage()"> <OPTION>Pull down this menu to choose whereabouts on the Sprezz site to go <OPTION VALUE="http://www.sprezzatura.com">Home Page <OPTION VALUE="http://www.sprezzatura.com/whatsnew.htm">What's New <OPTION VALUE="http://www.sprezzatura.com/senl.htm">SENL <OPTION VALUE="http://www.sprezzatura.com/patches.htm">Download S/LIST <OPTION VALUE="mailto:[email protected]">Send mail to support at Sprezzatura <OPTION VALUE="mailto:[email protected]">Send mail to sales at Sprezzatura </SELECT> </FORM>][/notag] </QUOTE> View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/5af7d7114f974898852568a4000caa26.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1