From: capt edgar on
Hi there
I need help passing extra arguments to one of the function in my
script. The code below is one of the functionality of the script and
it creates Log Folder


function CreateNewLogSubDir(){
var strSubdirName='';
strSubdirName=WScript.Arguments.Named.Item('New');
if('string'!=typeof(strSubdirName)||0==strSubdirName.length){
var strDate = new Date();
var iMonth =Number(strDate.getMonth()+1);
var sMonthPrefix = '';
if(Number(iMonth)<10){sMonthPrefix='0';}

strSubdirName=strDate.getFullYear()+'-';
strSubdirName+=sMonthPrefix+iMonth
+'-'
+(strDate.getDate() < 10 ? '0':'')
+(strDate.getDate());

I need to pass 4 arguments to the above script. These arguments are
values to input to the name of the newly created log folder and these
are the information passed from SourceSafe Change Mgt Sys

Arguments to pass are : 1) Enter Build
2)Enter Transaction Number
3)Enter Short Log Description

Ex: If i enter Build = 49834 and Transaction = 238113 and Short
Description = TestingSample, then the newly created Folder should have
the following name i.e.

2009-02-23-B-49834-T-238113-TestingSample

Is it possible to do this?. Please guide me

regards
From: Todd Vargo on
capt edgar wrote:
> Hi there
> I need help passing extra arguments to one of the function in my
> script. The code below is one of the functionality of the script and
> it creates Log Folder
>
>
> function CreateNewLogSubDir(){
> var strSubdirName='';
> strSubdirName=WScript.Arguments.Named.Item('New');
> if('string'!=typeof(strSubdirName)||0==strSubdirName.length){
> var strDate = new Date();
> var iMonth =Number(strDate.getMonth()+1);
> var sMonthPrefix = '';
> if(Number(iMonth)<10){sMonthPrefix='0';}
>
> strSubdirName=strDate.getFullYear()+'-';
> strSubdirName+=sMonthPrefix+iMonth
> +'-'
> +(strDate.getDate() < 10 ? '0':'')
> +(strDate.getDate());
>
> I need to pass 4 arguments to the above script. These arguments are
> values to input to the name of the newly created log folder and these
> are the information passed from SourceSafe Change Mgt Sys
>
> Arguments to pass are : 1) Enter Build
> 2)Enter Transaction Number
> 3)Enter Short Log Description
>
> Ex: If i enter Build = 49834 and Transaction = 238113 and Short
> Description = TestingSample, then the newly created Folder should have
> the following name i.e.
>
> 2009-02-23-B-49834-T-238113-TestingSample
>
> Is it possible to do this?. Please guide me

To pass arguments to a Sub/Function, add the arguments in the parenthesis.

CreateNewLogSubDir(Build, Transaction, Description)
....
strSubdirName+=sMonthPrefix+iMonth
+'-'
+(strDate.getDate() < 10 ? '0':'')
+(strDate.getDate())
+'-B-'
+Build
+'-T-'
+Transaction
+'-'
+Description;

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
From: Al Dunbar on


"capt edgar" <captedgar(a)googlemail.com> wrote in message
news:01dbbdc7-6d99-4569-902e-fdfc37ef063f(a)a15g2000yqm.googlegroups.com...
> Hi there
> I need help passing extra arguments to one of the function in my
> script. The code below is one of the functionality of the script and
> it creates Log Folder
>
>
> function CreateNewLogSubDir(){
> var strSubdirName='';
> strSubdirName=WScript.Arguments.Named.Item('New');
> if('string'!=typeof(strSubdirName)||0==strSubdirName.length){
> var strDate = new Date();
> var iMonth =Number(strDate.getMonth()+1);
> var sMonthPrefix = '';
> if(Number(iMonth)<10){sMonthPrefix='0';}
>
> strSubdirName=strDate.getFullYear()+'-';
> strSubdirName+=sMonthPrefix+iMonth
> +'-'
> +(strDate.getDate() < 10 ? '0':'')
> +(strDate.getDate());
>
> I need to pass 4 arguments to the above script. These arguments are
> values to input to the name of the newly created log folder and these
> are the information passed from SourceSafe Change Mgt Sys
>
> Arguments to pass are : 1) Enter Build
> 2)Enter Transaction Number
> 3)Enter Short Log Description
>
> Ex: If i enter Build = 49834 and Transaction = 238113 and Short
> Description = TestingSample, then the newly created Folder should have
> the following name i.e.
>
> 2009-02-23-B-49834-T-238113-TestingSample
>
> Is it possible to do this?. Please guide me

I'd suggest you post questions about jscript in a jscript newsgroup rather
than a vbscript one.

/Al


From: capt edgar on
On 5 Jan, 05:15, "Al Dunbar" <aland...(a)hotmail.com> wrote:
> "capt edgar" <capted...(a)googlemail.com> wrote in message
>
> news:01dbbdc7-6d99-4569-902e-fdfc37ef063f(a)a15g2000yqm.googlegroups.com...
>
>
>
>
>
> > Hi there
> > I need help passing extra arguments to one of the function in my
> > script. The code below is one of the functionality of the script and
> > it creates Log Folder
>
> > function CreateNewLogSubDir(){
> > var strSubdirName='';
> > strSubdirName=WScript.Arguments.Named.Item('New');
> > if('string'!=typeof(strSubdirName)||0==strSubdirName.length){
> > var strDate = new Date();
> > var iMonth =Number(strDate.getMonth()+1);
> > var sMonthPrefix = '';
> > if(Number(iMonth)<10){sMonthPrefix='0';}
>
> > strSubdirName=strDate.getFullYear()+'-';
> > strSubdirName+=sMonthPrefix+iMonth
> > +'-'
> > +(strDate.getDate() < 10 ? '0':'')
> > +(strDate.getDate());
>
> > I need to pass 4 arguments to the above script. These arguments are
> > values to input to the name of the newly created log folder and these
> > are the information passed from SourceSafe Change Mgt Sys
>
> > Arguments to pass are : 1) Enter Build
> > 2)Enter Transaction Number
> > 3)Enter Short Log Description
>
> > Ex: If i enter Build = 49834 and Transaction = 238113 and Short
> > Description = TestingSample, then the newly created Folder should have
> > the following name i.e.
>
> > 2009-02-23-B-49834-T-238113-TestingSample
>
> > Is it possible to do this?. Please guide me
>
> I'd suggest you post questions about jscript in a jscript newsgroup rather
> than a vbscript one.
>
> /Al- Hide quoted text -
>
> - Show quoted text -

Hi Al Dunbar

can u please send me the link to googlegroup for queries related to JS
Script

Todd

Thanks again
I'll try your suggestion and get back to you

regards
From: Tom Lavedas on
On Jan 5, 4:41 am, capt edgar <capted...(a)googlemail.com> wrote:
> On 5 Jan, 05:15, "Al Dunbar" <aland...(a)hotmail.com> wrote:
>
>
>
> > "capt edgar" <capted...(a)googlemail.com> wrote in message
>
> >news:01dbbdc7-6d99-4569-902e-fdfc37ef063f(a)a15g2000yqm.googlegroups.com....
>
> > > Hi there
> > > I need help passing extra arguments to one of the function in my
> > > script. The code below is one of the functionality of the script and
> > > it creates Log Folder
>
> > > function CreateNewLogSubDir(){
> > > var strSubdirName='';
> > > strSubdirName=WScript.Arguments.Named.Item('New');
> > > if('string'!=typeof(strSubdirName)||0==strSubdirName.length){
> > > var strDate = new Date();
> > > var iMonth =Number(strDate.getMonth()+1);
> > > var sMonthPrefix = '';
> > > if(Number(iMonth)<10){sMonthPrefix='0';}
>
> > > strSubdirName=strDate.getFullYear()+'-';
> > > strSubdirName+=sMonthPrefix+iMonth
> > > +'-'
> > > +(strDate.getDate() < 10 ? '0':'')
> > > +(strDate.getDate());
>
> > > I need to pass 4 arguments to the above script. These arguments are
> > > values to input to the name of the newly created log folder and these
> > > are the information passed from SourceSafe Change Mgt Sys
>
> > > Arguments to pass are : 1) Enter Build
> > > 2)Enter Transaction Number
> > > 3)Enter Short Log Description
>
> > > Ex: If i enter Build = 49834 and Transaction = 238113 and Short
> > > Description = TestingSample, then the newly created Folder should have
> > > the following name i.e.
>
> > > 2009-02-23-B-49834-T-238113-TestingSample
>
> > > Is it possible to do this?. Please guide me
>
> > I'd suggest you post questions about jscript in a jscript newsgroup rather
> > than a vbscript one.
>
> > /Al- Hide quoted text -
>
> > - Show quoted text -
>
> Hi Al Dunbar
>
> can u please send me the link to googlegroup for queries related to JS
> Script
>
> Todd
>
> Thanks again
> I'll try your suggestion and get back to you
>
> regards

http://groups.google.com/group/microsoft.public.scripting.jscript

or, to a lesser extent ...

http://groups.google.com/group/microsoft.public.scripting.wsh
_____________________
Tom Lavedas