[1.3.b66] StackOverflowError using long macro

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: [1.3.b66] StackOverflowError using long macro

Post by wolph42 »

ah for that is a trick as well. Generate all the output html into a variable and pass the variable back to a mother macro who pushes it to the UI.

So

charGen()
output = createCharGenHTML()
frame():{output}

where createHTML() is the function that generates the actual html.

aditionally you can read the stack overflow article linked in sig

Zandel
Giant
Posts: 133
Joined: Thu May 13, 2010 1:52 pm

Re: [1.3.b66] StackOverflowError using long macro

Post by Zandel »

Thank you

Zandel
Giant
Posts: 133
Joined: Thu May 13, 2010 1:52 pm

Re: [1.3.b66] StackOverflowError using long macro

Post by Zandel »

wolph42, would you happen to have any snipits of sample code where you used this methodology?

Thanks

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: [1.3.b66] StackOverflowError using long macro

Post by wolph42 »

well a very simple version is without a userdefined function:

Code: Select all

[output = "<html>Hello world</html>"]
[frame():{output}] 
the advantage however of putting
<html>Hello world</html>
in an external function is that you have more quotes at your disposal. Some html functions like tooltips require both " " and ' ' and in the above example you only have ' ' at your disposal.
If you don't go too fancy though than the above example works as well. The important part is that you separate the html from the frame:{} part.

Post Reply

Return to “MapTool”