Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » U++ Esc Interpreter, Esc Macros and templates » How to declare a global var without id in *.upt?
Re: How to declare a global var without id in *.upt? [message #3109 is a reply to message #3090] Sun, 07 May 2006 19:48 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
fudadmin wrote on Sat, 06 May 2006 08:49

fudadmin wrote on Sat, 06 May 2006 11:37

luzr wrote on Sat, 06 May 2006 06:10



Still not sure about that global var (but global vars really just :id).

Mirek


I'm not against id's! Smile But I don't want a field displayed for each of them. Is there a possibility without changing Template.cpp?


I think, I've tricked Esc and *.upt! Cool

<:!testf(){ return "testreturn"; }:> //declare a global function

<:testf():>   //this outputs "testreturn"

<:{ :testf=10; return;}:>  //make a global var from a function!!!

<:testf:>  //this outputs 10!!!


What can you say?



Well, you have not tricked Esc, this how it is designed. Lambda is value.

Maybe I am starting to get what is your confusion - you do not know how to "declare" global variable?

You do not need to declare variable in Esc, just to assign them.
Try:

<: :xxx = 10; :>

<: :xxx :>


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Esc: how to convert from string to number (or integer)?
Next Topic: Esc: how to use recursion?
Goto Forum:
  


Current Time: Mon Aug 25 16:56:40 CEST 2025

Total time taken to generate the page: 0.05251 seconds