Error when writing back the code




Exception rules concern words WITHIN character strings.
They allow to PROTECT these words before a possible camouflage
if they by chance have the same name like an identifier.

Change the copied source–code line so that a new exception rule is created.

Warning!
The identifier itself has already been replaced by the wildcard "$"!

A exception–rule consists of a text pattern (see below) that defines an EXCLUSION criterion.

If CrunchCode finds a code–line with such a pattern WITHIN A STRING,
it is NOT considered as a reference to an identifier and
it will not be camouflaged.


Notes: 1. A rule always applies to a WHOLE code–line (including those
    with the continuation operator "_" on several textlines)

2. The rules only apply to words WITHIN strings.
    They must contain at least two quotation marks,
    with the wildcard for the identifier name within them.

3. Rules are case insensitive.

4. Rules make no distinction between different data types.
    If there are identifiers with the same name but different data types,
    (e.g. procedure XXX, variable XXX, module XXX etc.)
    the rule will be applied to ALL identifiers.

5. The lines which are not grasped by a rule, but which contain
    character strings in which the name of an identifier appears,
    will be listed by CrunchCode during processing.
    The user can then decide whether it refers
    to an identifier or not.


The following special characters are available for the text patterns:

$ Wildcard for the identifier name
* no or any number text characters
? a single text character
# a single digit
[...] group of characters that could be applicable

To use one of these characters by itself,
use the following notation:

$ = \$
* = \*
? = \?
# = \#
\ = \\ z.B. "C:\XYZ" ––> "C:\\XYZ"
[ = [[]
] = \] z.B. "[A1]" ––> "[[]A1\]"

Remark: Before and after each rule CrunchCode sets the character "*",
to ensure that the entire command line is enclosed.
Special rules for the beginning or end of a code–line can therefore not be created.


Examples:

For the following examples it is assumed that there is a variable named "Price",
that is to be camouflaged. The same word must not be camouflaged where it occurs in some strings.

Exception–rules shall now be defined for these strings
and their effectiveness examined:

On the meaning of "camouflage prevented?"

Yes: The text pattern of the line fits the exception rule.
CrunchCode ignores the occurrence of the identifier within the string.
The text remains unchanged.

No: The text pattern of the line does not apply to the exception rule.
CrunchCode therefore assumes that the word within the string
could be a reference to the same identifier.
This line will be listed during processing
and the user must decide about each.


Exception rule camouflage prevented?
-------------------- --------------------------------

1. MsgBox("$")
   Yes    No
a) X = MsgBox("Price")      x
b) X = MsgBox("Price", 123)     x   further argument after "Price"
c) MsgBox "Price"     x   no brackets "(...)"
d) MsgBox "Price", 123     x   see a) and b)
e) X = MsgBox("Price total")     x   additional text exist
f) X = MsgBox("Fullprice")     x   "price" not separated


2. MsgBox[(]"$"* = whitespace!
   Yes    No
a) X = MsgBox("Preis")      x
b) X = MsgBox("Preis", 123)      x
c) MsgBox "Preis"      x
d) MsgBox "Preis", 123      x
e) X = MsgBox("Preis gesamt")      x   additional text exist
f) X = MsgBox("Gesamtpreis")      x   "price" not separated


3. MsgBox("*$*")
   Yes    No
a) X = MsgBox("Price")      x
b) X = MsgBox("Price", 123)     x   further argument after "Price"
c) MsgBox "Price"     x   no brackets "(...)"
d) MsgBox "Price", 123     x   see a) and b)
e) X = MsgBox("Price total")      x
f) X = MsgBox("Fullprice")      x


4. MsgBox("*$*"*)
   Yes    No
a) X = MsgBox("Price")      x
b) X = MsgBox("Price", 123)      x
c) MsgBox "Price"     x   no brackets "(...)"
d) MsgBox "Price", 123     x   further argument after "Price"
e) X = MsgBox("Price total")      x
f) X = MsgBox("Fullprice")      x


5. MsgBox "*$*"
   Yes    No
a) X = MsgBox("Price")     x   brackets exists
b) X = MsgBox("Price", 123)     x   brackets exists
c) MsgBox "Price"      x
d) MsgBox "Price", 123      x
e) X = MsgBox("Price total")     x   brackets exists
f) X = MsgBox "Fullprice"      x


6. * = "[$]\$"
   Yes    No
a) strTxt = "[price]$"      x
b) strTxt = "[price]"     x   "$" missing
c) strTxt = "Sum: [Price]$"     x   additional text exist


7. * = "*[$]\$*"
   Yes    No
a) strTxt = "[price]$"      x
b) strTxt = "[price]"     x   "$" missing
c) strTxt = "Sum: [Price]$"      x