Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Diferença entre $(iVar) e '$(iVar)'

Olá a todos!

Tive um problema apresentado no tópico Erro no Must_Include  e gostaria de entender a sintaxe na utilização de variáveis.

Como devem ser a utilização de ' ' (aspas) e $ na obtenção de valores de variáveis?

Ex:

Arq1=FileDir()&'QlikView\ApontamentoHoras-ScriptCarga.txt';

        $(Must_Include='$(Arq1)');

        ou

        $(Must_Include=$(Arq1));

Obrigada.

Labels (1)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

When you use a dollar expansion, it is replaced by the variable value before the parser reads the statement. So in your case,

   $(Must_Include='$(Arq1)');

will expand to 

   $(Must_Include='C:\Folder Name\QlikView\ApontamentoHoras-ScriptCarga.txt');


whereas

   $(Must_Include=$(Arq1));

will expand to 

   $(Must_Include=C:\Folder Name\QlikView\ApontamentoHoras-ScriptCarga.txt);


You will probably want to include this expansion in quotes, since the path contains blanks. In other cases, it is better to expand it without quotes, e.g. if the variable contains a number that you want to use in a calculation.

HIC



View solution in original post

3 Replies
Marcio_Campestrini
Specialist
Specialist

Françoise

Dê uma olhada nesses posts do hic

The Magic of Variables

The Magic of Dollar Expansions

Márcio Rodrigo Campestrini
hic
Former Employee
Former Employee

When you use a dollar expansion, it is replaced by the variable value before the parser reads the statement. So in your case,

   $(Must_Include='$(Arq1)');

will expand to 

   $(Must_Include='C:\Folder Name\QlikView\ApontamentoHoras-ScriptCarga.txt');


whereas

   $(Must_Include=$(Arq1));

will expand to 

   $(Must_Include=C:\Folder Name\QlikView\ApontamentoHoras-ScriptCarga.txt);


You will probably want to include this expansion in quotes, since the path contains blanks. In other cases, it is better to expand it without quotes, e.g. if the variable contains a number that you want to use in a calculation.

HIC



Anonymous
Not applicable
Author

Ótimas referências!

Obrigada pelos links Márcio.