newObjects (fromerly known as ZmeY soft) JScript/JavaScript code snippets
Home Products Development
pixel.gif (49 bytes)
Products by category
ALP area
ISAPI filters
Forums (discussions)
Articles and samples
Code snippets
A little help

Site navigation
Code snippets
JScript code

Downloads of the day
ActiveX Pack1 2.4.2
Desktop Windows, CE/CE.NET and PocketPC! About 30 powerful components for all the Windows platforms.
Active Local Pages 1.1
Write desktop apps in ASP and CGI. Create wutorun CDs using WEB technologies - yes it is possible!
Script Service
Run VBScript/JScript as service and call it just like a system wide COM object.
TCP/IP, IRDA and others - all as easy as access to files.
ASP Compiler 1.1 beta
Create COM DLLs from ASP pages, program the compiler itself.
ISAPI Variable Parser
ISAPI filter that converts path-like URLs to script calls with parameters

Quick contact

sprintf simple realization in JScript

JScript has no strict types thus this realization does not support C library
format, instead it supports format applicable for the Javascript specifics. It
has only field width and alignment capabilities implemented. Example sprintf("A=%20l,B=%30r","Blah
will generate string with % escapes replaced with 20 and 30
characters wide fields containing: 1-st "Blah Blah" left aligned in the field
and 2-nd 234.56 right aligned. Also it supports a little type conversion excapes
but their purpose is to specify the type of the printed value. Genraal format


- optional integer field width in characters. Only the resulting
string is formatted!

type - type to convert to. Can be f - convert to float or n
- convert to integer.

alignment - Alignment in the field (as specified by width). Can be l
- left, r - right, c - center. If width is not specified the
letter used is not meaningful.

Click the image below to download (sprintf.js-code)
click here ...

File prprocessor

UNIX OS-es have some good utilities for file preprocessing based on
regular expressions, but Microsoft Windows does not. But Microsoft Windows has powerful scripting
engines and WSH thus the problem can be solved.

This script is able to process files described by the command line parameters
and replace some texts in them. It supports directory tree recursing, matching
file names with regular expression, processing parts of the files files
depending on the begin-end statements (defined by reg. exps. too) and so on.

Please note! You must be familiar with the JScript regular expressions in order
to use this utility. Wrong usage may cause loss of data thus it is recommended to
test it over some not important files first.

Also download the JScript documentation from the Microsoft site and see Regular Expression
object for the regular expressions syntax.
click here ...

Active Local Pages

One common environment for desktop and WEB programming. Active Local Pages - WEB applications running on the desktop. Using the ALP WEB techniques are available for desktop programming - ASP and CGI are no longer server side only!

Check these sites
Win free license for Active Local Pages!
ASP Experts
Web development portal
English - Bulgarian dictionary online

Active visitors
Suggested links
Suggest this page to the other visitors. Click the button below to place this page in the list above .
Copyright newObjects (ZmeY soft) 2001