Gossamer Forum
Home : Products : Gossamer Mail : Development, Plugins and Globals :

GMail->parse_return - version for just returning?

Quote Reply
GMail->parse_return - version for just returning?
Hi,

Just wondering, is there a "return" style of this?

Code:
GMail->parse_return('calendar_day_list.htm', { args => \@args } );

?

I tried:

Code:
return GMail->parse_return('calendar_day_list.htm', { args => \@args } );

..but that still prints it out at the top of the template (which I don't want, as its a tags content)

TIA!

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] GMail->parse_return - version for just returning? In reply to
Hi,

I managed to work out a different approach, although I'd still be interested to know if it is possible to "reeturn" a template code directly - as its quite a handy too Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] GMail->parse_return - version for just returning? In reply to
Hi,

Mmm.. ok - maybe I didn't find a solution :(

I have this function:
Code:
my (@time_0,@time_1,@time_2,@time_3,@time_4,@time_5,@time_6,@time_7,@time_8,@time_9,@time_10,@time_11,@time_12,@time_13,@time_14,@time_15,@time_16,@time_17,@time_18,@time_19,@time_20,@time_21,@time_22,@time_23) = load_days_content(GT::Date::date_get());

sub load_days_content {
my (@time_0,@time_1,@time_2,@time_3,@time_4,@time_5,@time_6,@time_7,@time_8,@time_9,@time_10,@time_11,@time_12,@time_13,@time_14,@time_15,@time_16,@time_17,@time_18,@time_19,@time_20,@time_21,@time_22,@time_23);

# do stuff here to populate these arrays

return (@time_0,@time_1,@time_2,@time_3,@time_4,@time_5,@time_6,@time_7,@time_8,@time_9,@time_10,@time_11,@time_12,@time_13,@time_14,@time_15,@time_16,@time_17,@time_18,@time_19,@time_20,@time_21,@time_22,@time_23);

}

Now, this *appeared* to work ok - but its not. What it seems to be doing is returning all the arrays, but everything gets pushed into the @time_0 (line 1 of my code).

I know this prob isn't a GT problem, but anyone got any pointers? I can't work out why its doing this Pirate

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] GMail->parse_return - version for just returning? In reply to
Yikes. I don't personally know what date_get() returns but it looks like you need to have a re-think. I can't possibly imagine there is a need to create that many arrays in one go. If date_get is returning an array then obviously @time_0 is the only array that will get populated as @time_0 will receive the entire array that is returned.

I'm kinda surprised you don't already know that as a perl programmer - it's one of the basic fundamentals of the language and the use of subroutines.

I would suggest reading here:

http://perldoc.perl.org/perlsub.html
Quote Reply
Re: [Wychwood] GMail->parse_return - version for just returning? In reply to
Hi,

Those arrays (one for every hour), are needed - unfortunatly. This is because every different hour has a loop.

Anyway, I managed to solve the problem by putting the code from load_days_content() into the main routines. Seems to work fine :)

Thanks for the reply though.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] GMail->parse_return - version for just returning? In reply to
Quote:
Those arrays (one for every hour), are needed - unfortunatly. This is because every different hour has a loop.

In that case, references are a far better solution.