Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing array by reference from ASP to VFP COM Object
Message
De
14/06/1999 09:58:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Passing array by reference from ASP to VFP COM Object
Divers
Thread ID:
00229415
Message ID:
00229415
Vues:
51
I have tried to develop an implementation of a sort function in a VFP COM object, but I can't seem to be able to pass the array by reference.

I don't know if the error is in my VFP code or my ASP code.

Most of you probably don't deal with ASP, but you coud probably help me out with the VFP side...

Here is what I use as code for the COM component:

*********************************************************************
DEFINE CLASS COMTools AS Relation OLEPUBLIC

FUNCTION Init
SET UDFPARMS TO REFERENCE
ENDFUNC

FUNCTION BubbleSort
PARAMETERS laArrayName, lnLength, lnSize, lnElement, lnSortType

LOCAL i, j, laTemp, lnArrayElements

IF PARAMETERS() = 5 THEN

DECLARE laTemp[1, lnSize]

FOR i = 1 to lnLength
FOR j = (i) to lnLength
IF IIF(lnSortType = 2, laArrayName[j, lnElement] < laArrayName[i, lnElement], laArrayName[j, lnElement] > laArrayName[i, lnElement]) THEN
FOR lnArrayElements = 1 to lnSize
laTemp[1, lnArrayElements] = laArrayName[i, lnArrayElements]
ENDFOR
FOR lnArrayElements = 1 to lnSize
laArrayName[i, lnArrayElements] = laArrayName[j, lnArrayElements]
ENDFOR
FOR lnArrayElements = 1 to lnSize
laArrayName[j, lnArrayElements] = laTemp[1, , lnArrayElements]
ENDFOR
ENDIF
ENDFOR
ENDFOR
cTemp = ALLTRIM('')
FOR lnArrayElements = 1 to lnLength
cTemp = cTemp + '|' + STR(laArrayName[lnArrayElements, 1])
ENDFOR
RETURN cTemp
ELSE
RETURN .F.
ENDIF

ENDFUNC

ENDDEFINE
*********************************************************************

So I do set my parameters to be passed by reference, but I am not sure that this means that they are received by reference.

Is there a way to make VFP get a variable by reference, or is this only a problem on the ASP client?

If any of you know how to pass a variable by reference in ASP (Basically VBScript), please let me know.

Thanks in advance.

Etienne Paquin.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform