IDE and variable

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

bzncrew

IDE and variable

Post by bzncrew »

Sorry for all the newb questions.

I really like the IDE. It allows me to design my form with all its components.

However, when I try to set an initial VALUE to a variable, it changes it to a constant.

eg: VALUE cVar

Becomes VALUE "cVar"

Is there a way to change the IDE so it doesn't treat everything as a constant string in quotes?


--Russ
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: IDE and variable

Post by Javier Tovar »

Hola,

Creo que no amigo!, incluso si modificas aparte el archivo *.FMG y después lo quieres modificar el IDE te lo cambia, entonces la forma de proceder es, has todo lo necesario en el IDE y después lo modificas aparte.

Saludos
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: IDE and variable

Post by luisvasquezcl »

Hi,
you can write &cVar and out problem.
best regards,
Luis Vasquez.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: IDE and variable

Post by Javier Tovar »

Hola Luis Vazquez,

Creo que bzncrew lo que quiere es que desde el IDE se pueda poner la sentencia cVar en el valor del Label, pero esto en el IDE lo pone como "&cVar" que sigue siendo una cadena de caracteres y no una variable.

Code: Select all

    DEFINE LABEL Label_2
        ROW    130
        COL    100
        WIDTH  120
        HEIGHT 24
        VALUE "&cValor"
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        VISIBLE .T.
        TRANSPARENT .F.
        ACTION Nil
        AUTOSIZE .F.
        BACKCOLOR NIL
        FONTCOLOR NIL
    END LABEL
Lo que le sugiero es que después de generar el Form con el IDE haga la modificación en el NotePad++.

Saludos

P.D.: Si estoy en un error hasmelo saber. :D
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: IDE and variable

Post by luisvasquezcl »

Estimado
Prueba lo que estoy proponiendo. resulta.
Saludos cordiales,
Luis Vasquez
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

IDE and variable

Post by Pablo César »

luisvasquezcl wrote:Estimado
Prueba lo que estoy proponiendo. resulta.
Saludos cordiales,
Luis Vasquez
Si Luis, tenés razón. Eso que indicaste, tiene que funcionar. Tu estás correcto y gracias por sugerirlo. Pero lo que Javier alega es que talvez el colega quiera es que la IDE interprete como variable en lugar de string.

Lo que pasa que para que esto ocurra, la IDE deberia detectar: si se trata de una variable o string. Porque la IDE SIEMPRE irá tratar-la como string.

Image
luisvasquezcl wrote:you can write &cVar and out problem.
..//..
It's works !

Luis Vasquez.
Yes Luis, you're right. What you have indicated, must work properly. You are correct and thank you for suggesting it. But what is that maybe Javier alleges the bzncrew colleague wants is that the IDE must be interpreted: as variable instead of string.

What happens is that for this to occur, the IDE should detect if it is a variable or string. Because the IDE will ALWAYS treat the as-string.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: IDE and variable

Post by Javier Tovar »

Pablo César wrote:Si Luis, tenés razón. Eso que indicaste, tiene que funcionar. Tu estás correcto y gracias por sugerirlo. Pero lo que Javier alega es que talvez el colega quiera es que la IDE interpreta como variable en lugar de string. Lo que pasa que para que esto ocurra, la IDE deberia detectar, si se trata de una variable o string. Porque la IDE SIEMPRE irá tratar-la como string.
+1
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: IDE and variable

Post by mol »

In my opinion, it should stay as it is now.
It's good to do not mix definitions with code (problem with debugging wrong code).
You can always put this line after loading window:

Code: Select all

  Form_1.Label_2.Value := cVar
or

Code: Select all

  SetProperty("Form_1", "Label_2","Value", cVar)
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

IDE and variable

Post by Pablo César »

There is not another way Marek... because there are many most important pendings to be solved in our IDE. Now we have to use like as:

Form_1.Label_2.Value := cVar

or

SetProperty("Form_1", "Label_2","Value", cVar)

or

DEFINE LABEL ...
     ROW ...
     COL ...
     WIDTH ...
     HEIGHT ...
     VALUE "&cValor"

For now, we only have to conform like as is now... :cry:
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: IDE and variable

Post by Javier Tovar »

Pablo César wrote: because there are many most important pendings to be solved in our IDE.
+1
Post Reply