Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Transposing
Message
De
08/06/1999 09:48:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00222826
Message ID:
00227412
Vues:
20
>> FIELD1 FIELD2 FIELD3
>>  D       A     1
>>  D       B     2
>>  D       C     3
>>  E       A     4
>>  E       B     5
>>  E       C     6
>>  F       A     7
>>  F       B     8
>>  F       C     9
>
>What I was asking, was are you trying to get from the cross-table (the first example) to the table (second example)?
>
>
>No exactly but if you take the second example here what I wanted was to get
>FIELD1  FIELD2  FIELD3  FIELD4  FIELD5  FIELD6  FIELD7  FIELD8  FIELD9
> D       D       D       E      E       E        F      F        F
> A       B       C       A      B       C        A      B        C
> 1       2       3       4      5       6        7      8        9
>
>Thanks

PMFJI, but one way to do it could be to it with arrays like this:

DIMENSION laSource[1], laTarget[1]
SELECT * FROM Source INTO ARRAY laSource
DIMENSION laTarget[ALEN(laSource, 2), ALEN(laSource, 1)]
FOR i = 1 TO ALEN(laSource, 1)
   FOR ii = 1 TO ALEN(laSource, 2)
      laTarget[ii, i] = laSource[i, ii]
   ENDFOR
ENDFOR
CREATE CURSOR Target (Field1 <type>, Field2 <type>, ...)
APPEND FROM ARRAY laTarget
If the fields in the source cursor is of different types, you would of course have to do some type-casting to be able to store the result in the target cursor.

Arne
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform