Openkore.com

OpenKore Forums
It is currently 22 Nov 2018, 06:55

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Macro Subroutine help.
PostPosted: 28 Jul 2011, 09:49 
Offline
Noob
Noob

Joined: 28 Jul 2011, 09:35
Posts: 9
I'm having problem with with writing subroutines.

I want to get the output of time() in perl. From subroutine, I am able to return the value to the macros calling it, but I can't store the value into a variable.

Code:
#this is working
sub working{
   return $timeSnapShot;
}

macro test{
   log @eval(working)
}
#output: 1311864408


Code:
#this is not working
sub notworking{
   $timeSnapShot= $time();       
   return $timeSnapShot;
}

macro test{
   log @eval(notworking)
}
#output: [macro] test error: error in 0: @eval(notworking) failed


In the mean time, I'll just use the predefined variable $.time in macros.


Top
 Profile  
 
 Post subject: Re: Macro Subroutine help.
PostPosted: 22 Sep 2011, 08:39 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
Code:
$timeSnapShot= time();

no?

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group