_maskfit.pub Utility - Mask Fit

Syntax

call "_maskfit.pub",teststr,maskstr,strvar

Description

The _maskfit.pub utility compares teststr against maskstr and returns a pass/fail indication in the strvar string variable. If the text string does not fit the mask, then "NO FIT" is returned. If the fit is successful, null is returned.

The mask fit routine will accept "*" and "?" as wild card characters. The rules for wildcards are:

Character

Description

*

Matches any number of characters (including zero).

?

Matches any single character.

Any other character must match exactly.

Examples

1000 call "_maskfit.pub","John Ray","John D??",result$
1010 print result$
NO FIT
1000 mask$="JOHN D??",name$="JOHN DOE"
1010 call "_maskfit.pub",name$,mask$,result$
1020 if result$="" then result$="Good Fit"
1030 print result$
Good Fit
1000 mask$=str(12*79),name$="948"
1010 call "_maskfit.pub",name$,mask$,result$
1020 if result$="" then result$="Good Fit"
1030 print result$
Good Fit
1000 mask$="12*79",name$="123456789"
1010 call "_maskfit.pub",name$,mask$,result$
1020 if result$="" then result$="Good Fit"
1030 print result$
NO FIT

Related Files/Programs

_tables.dat

See Also

Alphabetical Utilities

Functional Listing of Utilities