utcstr.wbb - Unmask a String, Based on a Mask, and Return an Internal Value

Syntax

CALL "utcstr.wbb",text$,mask$,result$

Description

This program returns a value suitable for reformatting with the same mask, using the STR() function. Business BASIC developers often store formatted text values without any formatting and then display or print formatted versions using the STR() function. For example, a US zip code stored as "957625555" could be reformatted as "95762-5555" with the mask "00000-0000". This low-level routine examines a formatted text$ string and returns the unformatted result$ text string by comparing characters in text$ to the format specification in mask$.

Parameter

Description

text$

Formatted text string.

mask$

Specified format.

result$

Unformatted result text string.

The BASIC Web Utility high-level programs use this routine to convert formatted CGI input when a template specifies a nonnumeric data type and a user attribute of "mask=mask".