Home » Extra libraries, Code snippets, applications etc. » U++ Esc Interpreter, Esc Macros and templates » How to declare a global var without id in *.upt?
How to declare a global var without id in *.upt? [message #3068] |
Fri, 05 May 2006 22:09 |
|
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
How to declare global vars without id in *.upt?
I'm running out of space in the templates dialogue window...
But, anyway, is it possible to declare extra global vars without using id's or, maybe in the worst case, to hide those fields?
[Updated on: Fri, 05 May 2006 22:09] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to declare a global var without id in *.upt? [message #3126 is a reply to message #3125] |
Mon, 08 May 2006 07:32 |
|
mirek
Messages: 13986 Registered: November 2005
|
Ultimate Member |
|
|
fudadmin wrote on Sun, 07 May 2006 19:38 |
Can be a bug? Because it works like this:
|
Yes, sorry. <: is for expression, <:{ is for block of statements, that ';' makes it an expression.
Quote: |
Edit:
But, in this case, if I assign a number or a string Esc outputs them. Maps and arrays are OK.
|
What is wrong then?
BTW, strings are arrays, there is no difference. Also, maps are structures,
a.b
is same as
a["b"]
Mirek
|
|
|
|
|
Re: How to declare a global var without id in *.upt? [message #3131 is a reply to message #3130] |
Mon, 08 May 2006 14:15 |
|
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
luzr wrote on Mon, 08 May 2006 12:46 |
fudadmin wrote on Mon, 08 May 2006 06:46 | The problem is that if I assign to a global var a string or a number, their values are printed in the place of assignment. And that messes up *.h/*.cpp files...
|
Ah, of course, because if you do you <: :>, it is expression that gets evaluated and inserted. Use <:{ :global = ... ; }:> instead.
Mirek
|
Thanks! That works!
I didn't manage to guess that when unsuccessfully tried this one (with spaces between <: and { ):
Ech, those little things...
Anyway, Esc is PHP in Ultimate++!
[Updated on: Mon, 08 May 2006 14:16] Report message to a moderator
|
|
|
|
Re: How to declare a global var without id in *.upt? [message #3133 is a reply to message #3132] |
Mon, 08 May 2006 15:07 |
|
mirek
Messages: 13986 Registered: November 2005
|
Ultimate Member |
|
|
fudadmin wrote on Mon, 08 May 2006 08:58 |
luzr wrote on Mon, 08 May 2006 12:46 |
fudadmin wrote on Mon, 08 May 2006 06:46 | The problem is that if I assign to a global var a string or a number, their values are printed in the place of assignment. And that messes up *.h/*.cpp files...
|
Ah, of course, because if you do you <: :>, it is expression that gets evaluated and inserted. Use <:{ :global = ... ; }:> instead.
Mirek
|
No, in fact this doesn't work. Could you check if this works for you? For me it says "invalid expression"...
|
Maybe it will require .... return ""; } :>.
If it does, Expand needs fixing.
Mirek
|
|
|
|
Goto Forum:
Current Time: Mon Jun 17 08:57:11 CEST 2024
Total time taken to generate the page: 0.02445 seconds
|