Me intrigo eso de poder convertir definiciones en variables y empeze a hacer esto...
Pero "ya me trabe" con el manejo de los arrays.
Alguien lo quiere seguir ?
----------------------------------------------------------------------------------------------------------
I am intrigued by being able to convert definitions into variables and I started doing this ...
But "I'm stuck" with the management of the arrays.
Does someone want to follow him?
Code: Select all
#include "hmg.ch"
FUNCTION Main()
DEFINE WINDOW Form_1 AT 100,500 WIDTH 500 HEIGHT 200 TITLE "TEST" MAIN ON INIT Convert( )
@ 010 , 010 LABEL Label_01 WIDTH 400 VALUE "#DEFINE 2 PUBLIC VARIABLE" FONT "Arial" SIZE 20 BOLD
END WINDOW
Form_1.Activate
RETURN
*---------------------------------*
Function Convert( )
// THIS, IS IN MI CASE !!!
cColors := Memoread("D:\AGL\HMG\3.4.4\INCLUDE\i_color.ch" )
cColors := StrTran( cColors, "{", '",{' )
cColors := StrTran( cColors, "#define ", '{"' )
cColors := StrTran( cColors, "}", '} },' )
cColors := StrTran( cColors, CHR(9), "" )
cColors := "{ " + cColors + " }"
// hb_ATokens( <cString>, [<cDelim>|<lEOL>], [<lSkipStrings>], [<lDoubleQuoteOnly>] )
aTokens := hb_ATokens( cColors ) ; msgbox( ValType( aTokens ) ) ; msgbox( aTokens )
For i1 = 1 TO LEN( aTokens )
__mvPublic( aTokens[ i1, 1 ] )
__mvPut( aTokens[ i1, 1 ], aTokens[ i1, 2 ] )
NEXT
Return .T.
*---------------------------------*