Topic Options
#55778 - 03/12/18 10:57 AM Setting VBScript value for firstdayofweek
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
I have a script that uses the Week of Year to create a file. This is working.

However, it would seem that VBScript defaults to having Sunday as the first day of the year. The ISO standard is that Monday is the first day of the year. That is what we want to work with.

Setting the VBScript date part called firstdayofweek should fix this.

My question: should I be setting this each time the script runs? Or can it be set for the PlanetPress environment, so that "1" is always the first day of the week?

Thanks!

Top
#55790 - 03/14/18 09:16 AM Re: Setting VBScript value for firstdayofweek [Re: rfielder]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4953
Loc: Objectif Lune Montreal
Hi rfielder,

Unfortunately, there is no such setting in PlanetPress. In fact, there is no setting in PPress that affect how scripts behaves, since they are run by independant modules, so you will have to set the first day of the week in your script, and in all scripts that needs it.

Regards,
Raphaël Lalonde-Lefebvre

Top
#55816 - 03/16/18 02:04 PM Re: Setting VBScript value for firstdayofweek [Re: rfielder]
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
Raphaël

Thanks!

Top
#55835 - 03/28/18 02:55 PM Re: Setting VBScript value for firstdayofweek [Re: Raphael Lalonde Lefebvre]
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
Originally Posted By: Raphael Lalonde Lefebvre
In fact, there is no setting in PPress that affect how scripts behaves, since they are run by independant modules, so you will have to set the first day of the week in your script, and in all scripts that needs it.

I am trying to understand how this works, because VBScripts run under PlanetPress (PP) have access to PP internal variables, and have significant differences to scripts run on the same computer under cscript or wscript.

In other words, it would seem that PP is providing its own, enhanced and modified VBScript engine.

If that is the case, why can't PP provide details of how their VBScript engine works?

Top
#55839 - 03/29/18 03:35 PM Re: Setting VBScript value for firstdayofweek [Re: rfielder]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1928
Loc: Objectif Lune, Montreal, Qc
The Scripting Engine used by PPSuite is a customized version of Windows' Scripting Engine (WSE). The main difference is that the engine is instanciated by Workflow rather than by the traditional WScript component in Windows.

This allows Workflow to declare objects and methods that are available to its Scripting Engine. However, it also means that since the engine does not run under the WScript host, it cannot use WScript-specific objects and methods (like WScript.sleep, for instance).

Other than that, both engines are exactly the same.

Note, also, that every time a script runs, a new instance of the Scripting Engine is launched. Therefore, changes you make to the Scripting environement are only applied to that instance of the script, when it runs. That's also why you can't create a "global" VBScript variable that could be reused across multiple scripts.


Edited by Philippe F. (03/29/18 03:40 PM)
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top