Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing an array to a form?
Message
De
28/10/1998 14:46:46
 
 
À
28/10/1998 14:37:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00151844
Message ID:
00151852
Vues:
20
>Help!?!?!?!?!
>
>I'm getting an error message trying to send an array to a forms' init method...
>
>The array I'm trying to pass is being recieved as numeric!
>
>What gives?
>
>
>-----------------------
>Here's the code
>
>
>
<strong>
>
>***********************
>* in the calling .prg *
>***********************
>
>* create array of selected records
>nRetRec = RECNO()
>SELECT RECNO() FROM ( goApp.cCUserID + 'UPDAAPVMO1' ) WHERE MARKED INTO ARRAY aRecList
>IF _TALLY = 0
>    DIMENSION aRecList(1,1)
>    aRecList(1,1) = nRetRec
>ENDIF
>GOTO nRetRec
>
>* create EDIT form
>oEUPDAAPVMO1 = CREATEOBJECT( "UPDAAPVMO1_Edit_Class", aRecList )
>
>
>*****************************************************
>* in the class definition for UPDAAPVMO1_Edit_Class *
>*****************************************************
>
>*------------------------------------------------------------
>PROCEDURE INIT
>    LPARAMETERS aRecList
>
>    * Parent class sets datasession environment settings ( dele, esca, talk, excl, etc. )
>    DODEFAULT()
>    THIS.cOpAlias = goApp.cOpAlias
>
>    * set keys
>    IF ALEN( aRecList, 1 ) > 1      ------>
>                                    ------> "aRecList is not an Array"
>                                    ------>
></strong>
>
>Thanks for any help!

The dirty workaround is to declare Public Array Reclist. However, it's more OO way (if you want to stick to arrays, instead of cursors) having some object property array available (simplistically application object). Putting all values into this array (you can even use ACOPY()) you may access it from any other places of your application.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform