Source language: Translate to:

Useful VBS functions

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

Moderator: Neosoft Support

Useful VBS functions

Postby JnCon » Mon Jul 17, 2017 5:04 am

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}
Param=[%2]|Variable|Day of the week:
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}
Param=[%1]|Number|Number to be formatted:
Param=[%2]|Variable|Variable to store result:
publication.nbSetVar "[%2]", FormatNumber([%1], NoDecimals)
Posts: 4
Joined: Tue Sep 20, 2016 8:38 am

Re: Useful VBS functions

Postby Neosoft Support » Fri Jul 28, 2017 5:44 pm

Awesome! Thank you for sharing these with us.
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5621
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 0 guests