NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Automatic TimeStamp in comments?


Joined: 08 Sep 2009
Posts: 1
Reply with quote
Hello,

I am looking for a way to automatically insert a comment around code that contains a TimeStamp in it. For instance..
Code:

# START: imaginit:1073747490 [2009 Sep 08 12:05]
   
      function someFunction() {
             echo "test";
      }

# END: imaginit:1073747490 [2009 Sep 08 12:05]


I would want to automatically insert the comments around the selected code with the current time and date. Thanks for any insight!
View user's profileFind all posts by imaginitSend private message


Joined: 27 Apr 2007
Posts: 72
Reply with quote
You can use integration - write simple php script which adds these comments to code. In phped integrations settings check these settings :

    - for this macro work with editor -> take input from -> selected text
    - and also for returning output back to editor: work with editor -> return results to editor

php can be something like:

Code:

<?php
$input = return file_get_contents('php://stdin');
$time = date();

echo "# $time .... autor etc\n";
echo $input;
echo "# $time .... end\n";

View user's profileFind all posts by sirjardaSend private message
Automatic TimeStamp in comments?
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 vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic