Macro Language Reference > Macros > Document Preferences > compstyle
  
compstyle
Description
A control keyword used with fdpref: controls the preferences for compiled styles.
Syntax
colourbars bleed size:n bleed str:s
st_from
Minimum character length of style tag for compile styles to take effect on.
st_to
Maximum character length of style tag for compile styles to take effect on.
othr_from
Minimum character length of other tags for compile styles to take effect on.
othr_to
Maximum character length of other tags for compile styles to take effect on.
compxstring
Compile x-counter and format string indices.
0
Off
1
On
Additional Information
Found in the dialog Document > Preferences > Document > Speed
To compile x-counter and format string indices
It is common practise for documents to contain a script activated during autoexec to initialize a set of constants to allow named access to the format counters x(...) and $(...). For example, the script might start like this:
^idx=0
^_x_my_stored_value=^idx
^idx++
^_x_another_value=^idx
^idx++
..etc..
Now, instead of a show string like <?show sum is $^(x(0) + x(1))> which is unreadable, from version 8.13a we can have <?show sum is $^(x(^_x_my_store_value) + x(^_x_another_value))> which is more readable
However, the second version is slower to process as it involves looking up the values assigned to the ^_x_ variables. This new option will perform the lookup once during compilation so the format system sees the faster version.
The option is hard-coded to search for any sequence between angle brackets that begins x(^_x_....<br/>OR<br/> $(^_s_.... (in fact, the _s_ and _x_ prefixes are interchangeable and either will work in both cases). These are the most common prefixes used today.
 
Note that for this new option to work successfully, it is necessary for these 'constants' to be defined before the first format of the document. If they are not then 3B2 may compile some styles with blank replacements for the variables and the format will look bad. Alternatively, use the new tmem macro whenever index variables are added or changed to clear all compiled styles and cause them to be recompiled when next accessed.
Related Links