Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: steve sheridan
  Where is steve sheridan?
 hayward
 California - United States
 steve sheridan
 Tags
Subject: RE: Changing sort orders on cursors in a rep
Thread ID: 253976 Message ID: 310754 # Views: 30 # Ratings: 0
Version: Visual FoxPro 9 Category: Reports and Printers
Date: Friday, June 24, 2011 5:56:54 AM         
   


> I got it to work Stefan, thank you! I had to add another line of code that I copied from earlier in the form so it looked like this:
>
> INDEX ON invnum TAG invnum
> SET ORDER TO TAG invnum IN Poordedt_r
> THISFORM.ReportName='podtljnl.frx'
>
> I couldn't get it to sort by vendor name as the column containing the data is entitled "name" and I'm assuming there is a command by the same word as I got an error message when I tried this:
>
> SET ORDER TO TAG name, invnum IN Poordedt_r
>

You are right, "Name" is indeed a reserved word in Vfp that should be avoided "as a name", so to say.
But in this case the error might be that you can Set Order To one-tag-name only, as Anders pointed out.
Although in Vfp an Index expression can contain only one "type", so that you cannot do something like "Index On column1, column2" as you would in Oracle for instance, you can still concatenate expressions, usually converting each type to character().

* For instance, if "name" and "invno" are both Char() types, you can 
INDEX on name+invnum TAG nameinvnum

* Whereas if "invno" were Int or Num(), you can 
INDEX on name+STR(invnum) TAG nameinvnum && or 
INDEX on name+BINTOC(invnum) TAG nameinvnum


BTW, the Poordedt_r alias probably is a temporary cursor, something like a "Select ... Into Cursor ..." result, so that creating index expressions at run time makes sense, right?



hth
-Stefan

ENTIRE THREAD

Changing sort orders on cursors in a rep Posted by Neil Phelan @ 2/18/2010 1:28:40 PM
RE: Changing sort orders on cursors in a rep Posted by ho me @ 2/18/2010 2:44:57 PM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 2/18/2010 4:57:08 PM
RE: Changing sort orders on cursors in a rep Posted by ho me @ 2/19/2010 6:48:14 AM
RE: Changing sort orders on cursors in a rep Posted by Anders Altberg @ 2/19/2010 11:56:11 AM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/21/2011 6:31:14 PM
RE: Changing sort orders on cursors in a rep Posted by Anders Altberg @ 6/21/2011 6:50:20 PM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/22/2011 1:20:23 AM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 6/22/2011 9:35:23 AM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/22/2011 8:00:15 PM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 6/23/2011 5:26:58 PM
RE: Changing sort orders on cursors in a rep Posted by Anders Altberg @ 6/23/2011 8:04:10 PM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 6/24/2011 5:56:54 AM
RE: Changing sort orders on cursors in a rep Posted by steve sheridan @ 7/13/2011 11:17:42 PM
RE: Changing sort orders on cursors in a rep Posted by Stefan Wuebbe @ 7/14/2011 5:58:41 AM