Posts: 713
Monday, 03 August 2015, 15:26
Subject: Como Obtener En Runtime El Nombre De Una Variable
Es medio tonta la pregunta, pero no lo estoy consiguiendo
por ejemplo
se entiende
Last edited by tercoIDE on Monday, 03 August 2015, 15:27; edited 1 time in total
Posts: 4175 Location: dos hermanas, sevilla
Monday, 03 August 2015, 19:55
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
Seguramente Vuott sepa alguna manera de sacar ese dato usando punteros.....
Pero se me ocurre una solución fácil:
Create una clase, con la propiedad valor y nombre, entonces es muy sencillo decir que te muestre o cambiar el nombre,.... no se si te servirá...
Posts: 713
Monday, 03 August 2015, 22:42
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
no me sirve, esta es la rutina real:
Public Sub DebugMe(mf As Float[], filas As Integer, Optional columnas As Integer = 1)
' Rutina para mostrar matrices y vector en el Debug
' para vectores, poner columna=1
Dim f As Integer, c As Integer, stmat As String
'stmat = mf
If columnas = 1 Then
For f = 0 To filas - 1
'modMatriz8.abanda(a, b, a)
stmat &= Format$(mf[f], "0.000000") & " "
Next
Debug stmat
stmat = ""
Else
For f = 0 To filas - 1
For c = 0 To columnas - 1
'modMatriz8.abanda(a, b, a)
stmat &= Format$(mf[f, c], "0.000000") & " "
Next
Debug Str$(f), stmat
stmat = ""
Next
End If
'Stop
End
que sirve para volcar el contenido de una matriz o vector en el debug
me gustaria tambien volcar el nombre de la matriz que estoy debugueando
el workaournd es facil, porque llamo a un
Debug "fMatrix1"
DebugMe(fMatrix1, filas)
y ya, pero queria ver si hay una solucion mas elegante
Posts: 2086
Monday, 03 August 2015, 22:48
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
Seguramente Vuott sepa alguna manera de sacar ese dato usando punteros.....
¡No exageremos! Punteros no son el
Padre Eterno !
Posts: 1786 Location: Uruguay
Wednesday, 05 August 2015, 14:47
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
¡No exageremos! Punteros no son el
Padre Eterno !
es que vos nos mal acostumbras con tus soluciones eitenianas
jajajajja
Posts: 2086
Sunday, 16 August 2015, 16:44
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
...bueno...sì, existe una posiblidad usando la Clase "
Class", pero la variable debe haber sido declarada "
Global" y "
Pública" .
Ejemplo pratico:
Public nombre_variable As Integer
Public Sub Main()
' Si el nombre de la variable es compuesto por más que 4 carácteres, entonces el índice es 1 (si hasta 4 el índice es 0) !
Print Class.Load("MMain").Symbols[1]
End
Last edited by vuott on Sunday, 16 August 2015, 16:53; edited 3 times in total
Posts: 713
Tuesday, 25 August 2015, 17:28
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
claro, pero no es el caso
(en octubre estare en Parma, vives cerca?)
Posts: 2086
Tuesday, 25 August 2015, 19:00
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
Se necesita preguntar a Minisini en cual
Estructura de los codigos fuentes C de
gambas es contenido el nombre-identificador de una variable.
Posts: 2086
Monday, 04 April 2016, 15:19
Subject: Re: Como Obtener En Runtime El Nombre De Una Variable
¡No exageremos! Punteros no son el Padre Eterno !
......pero... tal vez pueden competir con
Él.
Vamos a ver con un
Puntero a una variable de tipo
String todas las variables
locales existentes en un proyecto:
Last edited by vuott on Monday, 04 April 2016, 23:08; edited 3 times in total
Page 1 of 1
You
cannot post new topics
You
cannot reply to topics
You
cannot edit your posts
You
cannot delete your posts
You
cannot vote in polls
You
cannot attach files
You
can download files
You
cannot post calendar events