Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids and Arrays
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00793404
Message ID:
00793431
Views:
54
Hi Neil,

You don't need array in this case because you can use a query to SUM fileds directly into cursor. It's also bad idea to use hardcoded path in you code because if location of data ever changes you'll have to go throuh all your code to fix it.

>Thankyou Sergy,
>
>Here is that syntax I have and I have added it to the Init event on the Grid.
>
>PUBLIC neil
>DIMENSION neil(5)
>SET FIELDS global
>SET EXACT ON
>
>SELECT distinct  t1.*, t2.key3, t2.key4 ;
>from ("C:\Project\data\modacad.dbf") t1 ;
>left outer join ("C:\Project\data\modacad.dbf") t2 ;
>on t1.key3 = t2.key3 and t1.key4#t2.key4 ;
>where t1.Key4 = 'SAMPLE' and t1.chk13=.T.  ;
>order by t1.key3 ;
>into cursor crsmatch
>
>SET FIELDS TO crsmatch.key1, crsmatch.key2, crsmatch.key3_a, crsmatch.key4_a, crsmatch.key4_b, ;
>crsmatch.cosamp=IIF(crsmatch.key4_a='SAMPLE',1,0), crsmatch.cotech=IIF(crsmatch.key4_b='TECHNICAL',1,0), ;
>crsmatch.chk13
>
>SUM TO ARRAY neil
>
>CREATE CURSOR result FROM ARRAY neil
>
>with this
> .RecordSourcetype = 0
> .RecordSource = 'Select * from result'
> .ColumnCount = 10
>
>ENDWITH
>
>Is this right?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform