Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP equivalent of Clipper's Aadd() function?
Message
De
18/05/1998 16:14:31
 
 
À
18/05/1998 03:41:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00100035
Message ID:
00100194
Vues:
23
>>I'm converting a Clipper app to VFP and there are many occurances of the Aadd() function. I'd like to write my own Aadd() to mimic Clipper's, if possible without changing the function calls at all.
>>
>>Here's an example of the Clipper calls...
>>
>>
>>AAdd( aSortInfo, { IDOCOMP.SORTREF1, IDOCOMP.SORTNAME1, IDOCOMP.FLREF } )
>>
>>
>>AAdd( aKeys, IDALTF.ELREF )
>>
>>Remember, I'd like to leave these calls unchanged...
>>
>>TIA
>>
>>Larry
>
>It shouldn't be too hard, as long as you aren't trying to implement sparse arrays. ALEN() can be used to determine the current size of the array (get the # rows, # cols), use DIMENSION to redimension the array to add a row (this will create a row filled with logical .F. as the last row of the array, and then for each column in the array, replace the equivalent column of the last row with the parameter corresponding to the position. The arrray must be passed by reference explicitly. A brain-dead simpl example:
>
>

>FUNCTION AddAnArrayRow
>lparameter taarray, tuarg1, tuarg2, tuarg3, tuarg4
>local ncol, nrow
>ncol = ALEN(taarray,2)
>nrow = alen(taarray,1)
>dimension taarray[nrow+1, ncol]
>local nCtr
>FOR nCtr = MIN(ncol,4)
> taarray[nrow+1,nCtr] = EVAL('tuarg'+str(cNtr,1))
>ENDFOR
>RETURN .t.
>
>DIMENSION myArray[1,2]
>MyArray[1,1] = 'First'
>MyArray[1,2] = 'Second'
>=AddAnArrayRow(@MyArray,3,'Four')
>=AddAnArrayRow(@MyArray,'Five',6.000)

That's what I was afraid of... guess I'll have to visit each call to Aadd() and add the @ sign, etc...

shucks

Thanks though...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform