CADDIT CAD CAM CNC Software - download AutoCAD compatible design software progeCAD Alibre T-FLEX and more
CADDIT Website Knowledge Base Search:
CL

progeCAD Help

CR
Welcome to progeCAD
Working with progeCAD
Command Reference
CAD System Variables
Programming progeCAD
Full Index (caution - 400kb)

Further Links:

Download progeCAD
Register progeCAD

Learning

T-FLEX PLM tutorial (PDF)
progeCAD IntelliCAD and AutoCAD training 
CATIA 2D 3D design tutorial
Alibre CAD/CAM basic tutorial

Resources

Educational CAD Software Solutions
Python scripting for DOS and Windows
Other free software downloads
CADDIT CAD CAM Forum Australia
__

(wcmatch string pattern)


Search that string.


This function finds internal string matches. You can see if a certain string is found, or match it with another string.

For example, if you had a string variable called MYVAR which contained the string "SUPERCALIFRAGILISTIC123\##" and you wanted to see if the characters "FRAG" were anywhere in the string you could use the wcmatch function, as follows:

  • (wcmatch MYVAR "*FRAG*")

If a match is found, wcmatch returns T. If no match is found, nil is returned. The wcmatch function is case-sensitive. To find a match, you should use strcase to change everything to uppercase if necessary.

You can use several wildcards for wcmatch:

Wildcard Definition
~ (tilde) Pattern not found in string.
* Standard wildcard; can be used anywhere.
? Matches for a space held by a character or number; number of question marks (?) must exactly match number of characters or numbers in the string.
# (pound) Matches any single number.
@@ Matches any single character; may not be a number.
. (period) Matches any single non-alphanumeric character.
(space) Matches one or more spaces.
[ ] Matches for any of the characters enclosed in the brackets.
[~ ] True only if there are extra characters not included in the brackets.
[ - ] (hyphen) Searches within a predefined range pattern.
, (comma) The "or" option.
' (reverse quote) Read next character literally; use for special characters.

Examples

Code Returns Comments
(setq N "11234 TROPICANA AVE.#@")    

 

   
(wcmatch N "~345") T "345" is not found in the pattern.
(wcmatch N "*opic*" ) T "opic" is found with anything before and after.
(wcmatch N "?????????????????????") T There are 21 characters, numbers and spaces in this string.
(wmatch N "#####*") T Matches 5 digits, followed by anything.

(setq symbol1 statement1 [symbol2 statement2] ...)

(substr string start [length])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language

CADDIT® is a registered trademark in Australia. All Rights Reserved. Comments concerning the content of this site should be addressed to our webmaster. progeCAD is a trademark of ProgeCAD srl. Autodesk® and AutoCAD® are both registered trademarks or trademarks of a third party, and used only for comparison purposes. All other trademarks, trade names or company names referenced herein are used for identification only and are the property of their respective owners. Legal and Terms of Use. Google. Find us on Google+.