Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Help on Array
Message
From
26/07/1999 10:10:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/07/1999 09:05:10
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00246025
Message ID:
00246050
Views:
15
>I need Help on Array and I am Very poor coding on array
>
>I have a table which contains custcode,mthcode,model,Interest,carnode.
>It is suppose to display in report like this:-
>
>custcode mthcode model interest carnode
>C00001 B1 3000 40 SW11
>C00001 B2 4000 45 SE12
>C00001 B3 5000 50 SWQ2
>C00001 B4 6000 55 FE53
>C00001 B5 7000 60 GT66
>
>But I want to display in report like this:-
>
>Custcode : C00001
>
>Mthcode B1 B2 B3 B4 B5
>Model 3000 4000 5000 6000 7000
>Interest 40 45 50 55 60
>Carnode SW11 SE12 SWQ2 FE53 GT66
>
>
>I believe that Array can help on this, Anyone Can help me on this report and coding. I tried to use crosstab But It fail.
>
>I appreciated if you can provide me a code. Thanks.
create cursor myCursor ;
 (cust_code c(6), Descrp c(10), B1 c(10), ;
  B2 c(10), B3 c(10), b4 c(10), b5 c(10))
index on cust_code+Descrp tag cust_code
lnSize = fsize("b1")
select OriginalTable
scan
 if !seek(cust_code,"myCursor", "cust_code")
     insert into myCursor ;
        (cust_code , Descrp) values ;
        (OriginalTable.cust_code, "Model")
     insert into myCursor ;
        (cust_code , Descrp) values ;
        (OriginalTable.cust_code, "Interest")
     insert into myCursor ;
        (cust_code , Descrp) values ;
        (OriginalTable.cust_code, "Carnode")
  endif
  lcField = mthcode
  =seek(cust_code+"Model","myCursor", "cust_code")
  replace (lcField) ;
       with padl(OriginalTable.model,tnSize," ");
       in "myCursor"
  =seek(cust_code+"Interest","myCursor", "cust_code")
  replace (lcField) ;
       with padl(OriginalTable.Interest,tnSize," ") ;
       in "myCursor"
  =seek(cust_code+"Carnode","myCursor", "cust_code")
  replace (lcField) ;
       with typeconvert(OriginalTable.Carnode)
       in "myCursor"
endscan
select myCursor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform