Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array returning value from wrong column?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00691883
Message ID:
00691888
Vues:
10
This message has been marked as the solution to the initial question of the thread.
I don't see why you need ASCAN.
USE \data\reference\lookup IN 0 SHARED
LOACAL ARRAY aagency[1]
SELECT desc FROM lookup ;
   WHERE code = 73 AND id = aagency.certwx ;
   INTO ARRAY aagency
USE IN lookup
IF _TALLY > 0
  REPLACE certw.agency WITH aagency[1]
ENDIF

* OR
USE \data\reference\lookup IN 0 SHARED
LOCATE FOR code = 73 AND id = aagency.certwx
IF FOUND()
  REPLACE certw.agency WITH Lookup.desc
ENDIF
>I load a two dimensional array with a name and a name code column.
>For example- Name=Steve Kramer Code=SK.
>
>How do I get the REPLACE command below to grab the value in the name column. It keeps grabbing the value from the name code column. So I end up with SK instead of Steve Kramer in my field.
>
>certwx.agency field is CHAR 2 with a value of SK or other name code.
>certw.agency field is CHAR 40 with a value of Steve Kramer or other name.
>
>
>USE \data\reference\lookup IN 0 SHARED
>PUBLIC ARRAY aagency(50,2)
>SELECT allt(desc), allt(id) FROM lookup WHERE code = 73 INTO ARRAY aagency
>USE IN lookup
>	
>gnPos = ASCAN(aagency,certwx.agency)
>IF gnPos !=0
>   REPLACE certw.agency WITH aagency(gnPos)
>ENDIF
>
>
>Thank you very much!
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform