The typical use of ASCII Exporting from CabMasterPro is to make mass changes to a library. Export Editor caters for this by providing a Replace action, where you can set certain values of filtered export lines. To create a Replace action, click the "New Action" button and select "Edit lines by setting" from the Action list. All the filter lists are hidden except for the Field list, where you can select "Value" or "Formula". The other two options (Name and Context) are unavailable because editing them may make the lines invalid for importing into CabMasterPro.
A replace action can be placed any where in a script just like a filter, but unlike filters the position makes a big difference. This is because a replacement acts on any lines which have not been filtered out by that point in the script. If you place it right at the top, every line in the export file will have its value or formula set to the specified value, even though those lines may get filtered out further down the script. Because of this, you should first filter down to the lines you want and then do any replacements.
When editing a field, its often useful to modify the existing value of that field. For example, you may wish to wrap a function name around the formula field - i.e. you want "some formula" to become "MRound(some formula)". You couldn't just type this exact string into the new value text box because other lines may have some other formula. We need to be able to access the original value of the field when figuring out the new value. If you include the string "%0" (percent zero) in the new value, it will be replaced with the exact text of the original field from each export line. So the correct value to enter would be "MRound(%0)". There is another one of these parameter strings: "%Q", which gets replaced with the original value with extra quotes stripped off.
Some examples to clarify:-
Original Value | Replacement String | Resulting Value |
---|---|---|
"""DoorWidth + DoorGap""" | "MRound("some formula")" | "MRound("some formula")" |
"""DoorWidth + DoorGap""" | "MRound(%0)" | "MRound("""DoorWidth + DoorGap""")" |
"""DoorWidth + DoorGap""" | "MRound(%Q)" | "MRound(DoorWidth + DoorGap)" |