Hello friends :
I need to create as many variables with records as a database.
How can I include a registry value in the name of each variable.
For example the content of the database is as follows
001 0100
002 0101
003 0102
004 0103
005 0200
I need to create the variables: npv0100 = 100, npv0101 = 101, npv0102 = 102, npv0103 = 103, npv0200 = 200
How can I do this?
Hola Amigos :
necesito crear tantas variables con registros tenga una base de datos .
Como puedo hacer para incluir en el nombre de cada variable un valor del registro .
Por ejemplo el contenido de la base de datos es el siguiente
001 0100
002 0101
003 0102
004 0103
005 0200
Necesito crear las variables : npv0100 = 100 , npv0101 = 101 , npv0102 = 102 , npv0103 = 103 , npv0200 = 200
Como puedo hacer para realizar esto ?
Saludos
Mario Rafael Mansilla
Crear variables / Create variables
Moderator: Rathinagiri
-
- Posts: 270
- Joined: Wed Aug 13, 2008 2:35 pm
- Location: Córdoba - Argentina
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: Crear variables / Create variables
hi,
---
Macro are slow so i would think about Array
Code: Select all
cString := "nvp"+STRZERO(nValue,4)
&cString := nValue
Macro are slow so i would think about Array

have fun
Jimmy
Jimmy
Re: Crear variables / Create variables
Code: Select all
FUNCTION Otro()
*Porque variables y no un Array ?
*Como sabras el nombre de una variable en especifico si el valor es variable ? Y si hay valores duplicados ?
FOR i = 1 TO 100
cX := "npv"+STRZERO( i, 4 )
&cX := i
NEXT
SAVE ALL LIKE npv* TO MyVars
MSGBox( "Termino..." )
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2220
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Crear variables / Create variables
Hi,
Create var:
__MVPUBLIC( <cVarName> )
__MVPRIVATE( <cVarName> )
Set/get vale
__MVPUT( <cVarName> [, <xValue>] ) --> <xValue>
__MVGET( <cVarName> ) --> <xVar>
Check:
__MVEXIST( <cVarName> ) --> <lVariableExist>
Create var:
__MVPUBLIC( <cVarName> )
__MVPRIVATE( <cVarName> )
Set/get vale
__MVPUT( <cVarName> [, <xValue>] ) --> <xValue>
__MVGET( <cVarName> ) --> <xVar>
Check:
__MVEXIST( <cVarName> ) --> <lVariableExist>
- serge_girard
- Posts: 3309
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Crear variables / Create variables
Great to have you back, Claudio!
Serge
Serge
There's nothing you can do that can't be done...