Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index expression involving negative numbers
Message
From
10/08/2001 11:08:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Index expression involving negative numbers
Miscellaneous
Thread ID:
00542299
Message ID:
00542299
Views:
38
Hi All,

How can I create an index expression (in the case below tag Amount1) involving two numeric values (pp_NumOper and pp_Amount) when one of them (pp_Amount) can assume negative values, getting the proper sorting sequence (i.e. from the smallest value to the biggest value, considering their algebraic values and not their absolute values).
 Create Cursor CurPagtos          ;
        (                         ;
          pp_NumOper   N ( 6)   , ;
          pp_Amount    N (14, 2)  ;
        )

 Index on Str  (pp_Amount, 14, 2) + Str (pp_NumOper, 6) Tag Amount1
 Index on       pp_Amount                               Tag Amount2

 nAnyValue = 123

 For nAmount = -10 To 10 Step 1

     Insert into CurPagtos (pp_NumOper, pp_Amount) ;
                    Values (nAnyValue , nAmount  )
 EndFor
                
 Set Order To Amount1
 Browse
If I could create an index expresion involving just pp_value (tag Amount2) it works fine, but that's not the case, I must add pp_NumOper also (the example above was simplified from the real one).

Any help appreciated!

Thanks,

Fernando
Next
Reply
Map
View

Click here to load this message in the networking platform