|
|
Place Holders in ezScript |
SolutionThe following explains why it is not possible to remove place holders without breaking up a string in ezScript:Assume we are inserting a text file with a custom made text parsing rule. 1. Firstly a buffer is fed all the contents of the text file that is being inserted. 2. The context strings are applied and the context strings are taken out. 3. Every time a context string is taken out, a new buffer is started at the end of the context string. So for example if a context string is working on the string in bold below while taking out anything between [{}] and {}: TEXTTOTRANSLATE = " Hi my name is {name}, today is [{day}], the time is [{time}], I am {age} years old." END The context string will break the string into 5 buffers: Buffer1 = TEXTTOTRANSLATE = " Hi my name is Buffer2 = , today is Buffer3 = , the time is Buffer4 = , I am Buffer5 = years old." END If the characters are split into different buffers, they cannot be parsed into the same string, as shown below. 4. When the following text parsing rule START TAG: TEXTTOTRANSLATE = " END TAG: " END is then applied, it treats every buffer as a new start. So Buffer1 would match TEXTTOTRANSLATE = " and then begin parsing in Hi my name is but it does not come across the end tag: " END in that buffer so it is disregarded and not parsed in. The buffers 2,3,4 and 5 do not get any match because none of them have the start tag: TEXTTOTRANSLATE = " Therefore nothing gets parsed in. Context strings are mainly used for taking comments out of a file.
Products or Versions Affected
|