Useful VBS functions

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Locked
JnCon
Posts: 7
Joined: Tue Sep 20, 2016 8:38 am

Useful VBS functions

Post by JnCon »

I just want to share two useful NB functions in VBS you can use the in any publication.

1. Weekday from date (returns with the name of days from date):

{NeoBook Function}
Version=5,80
Language=VBScript
Param=[%1]|Number|Date:
Param=[%2]|Variable|Day of the week:
{End}
publication.nbSetVar "[%2]", Weekday("[%1]",0)

2. Formatting numbers

In some cases you need to display the numbers in decimal groups. For example 1 234 567 USD looks better than 1234567 USD. This simple script can do this:

{NeoBook Function}
Version=5,80
Language=VBScript
Param=[%1]|Number|Number to be formatted:
Param=[%2]|Variable|Variable to store result:
{End}
publication.nbSetVar "[%2]", FormatNumber([%1], NoDecimals)
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: Useful VBS functions

Post by Neosoft Support »

Awesome! Thank you for sharing these with us.
NeoSoft Support
Locked