Wild Media Server Wild Media Server
 
 
 
E-Mail Us
Home Product Info Download Buy Forum Feedback Extend Trial Contact Us Sitemap
 
It is currently Wed Dec 01, 2021 6:18 pm

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Library for user scripts
PostPosted: Thu Jan 26, 2012 3:06 pm 

Joined: Tue Sep 14, 2010 10:41 pm
Posts: 9
I was wondering whether it's possible to have some of my scripts (Pascal functions) stored in one place, so that they could be used in many places of WMS.

Maybe it's going to be easier with an example...

I have several collections that are generated automatically using a script.
There's a separate collection for movies added to the library in last week, last month, last 3 months.
The only thing that is different in those scripts is the number of days since the movie has been added.
So what I did is I wrote a script that finds such movies and copied that script in 3 different collections (with only one thing being different - number of days sine media item has been added).

What happens now is that whenever I need to change something in the way movies are found within the library, I need to change the same script 3 times instead of doing this only once.

For me the best would be if I could do something like (sort of pseudo-code below):
Code:
Script1:
import (myFunction(int noDays))
myFunction(7);

Script2:
import (myFunction(int noDays))
myFunction(30);

Script3:
import (myFunction(int noDays))
myFunction(90);


Do you think something like that is even possible in PascalScript?
Maybe in other language supported by WMS - language is not a problem - the only thing is, I'd love to be able to import functions from some kind of general library of user functions...


Top
   
PostPosted: Sat Jan 28, 2012 2:29 pm 

Joined: Tue Nov 17, 2009 8:05 pm
Posts: 2918
http://www.fast-report.com/pbc_download/files/fs_en.pdf

Code:
uses 'c:\temp\test.pas';

begin
  A
end.

c:\temp\test.pas
Code:
procedure A;
begin
  ShowMessage('A')
end;

begin

end.


Top
   
PostPosted: Wed Feb 01, 2012 5:31 pm 

Joined: Tue Sep 14, 2010 10:41 pm
Posts: 9
Great!
Exactly what I needed - works perfectly.


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

All times are UTC


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:  
cron
Copyright 2009-2020 Wild Media Server Powered by phpBB® Forum Software © phpBB Limited