Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

FOSI comparison


FOSI comparison

There may be a more direct FOSI-ish way to do it, but as a last resort,
I would assume you could do it using an ACL SYSTEM_FUNC, something along
these lines:


<specval attname="fosicompare" attloc="SYSTEM-FUNC&lt;br"/><">http://localhost:62953/aeFosi/help1325.html?queryId=135f845da96> "



<usetext source="\This" element=" has=" no=" content\&quot;=">




in doctype.acl:

function fosicompare(window, oid) {

# compare A.txt and B.txt, return 1 if they are equal

return (fosivar_value(window, "A.txt", oid)==fosivar_value(window,
"B.txt", oid));



Clay Helberg

Senior Consultant



FWIW you can also call attname="packagename::functionname" if you load that
package on PE, say from editinit. In either case, you can also return
values from the function you are calling, so you might have something like:

<specval attname="packagename::functionname" attloc="system-func"&lt;br"/>attval="no">
<specval attname="packagename::functionname" attloc="system-func"&lt;br"/>attval="yes">

I don't have any that test against numbers, but presumably you could do
that if you wanted to.

Take care with system-func calls, however. It is possible to consume a lot
of CPU. I don't remember the "math," but if a system-func is called too
often, or recursively, or some such, you can bring PE to its knees.

For this reason alone, I agree with Clay's categorization of these as a
"last resort."

You are so right -- certain system-funcs or too many system-funcs can slow formatting to a crawl or worse. That's why I strongly recommend using system-func only as a last resort, even though it may be very tempting to use ACL as a shortcut for FOSI coding. One of the reasons FOSI formatting is fast is because charlist coding is compiled. However, attribute processing must be handled in real-time for each document.

An ACL pre-print process, on the other hand, can be quite fast, and may provide a good alternative to system-func.


Note that in this example, there are two e-i-cs: one with the enumerate and savetext categories and another with the #FOSI test.#FOSI does not work in the same e-i-c with the enumerat and savetext categories. The workaround is to put the #FOSI test in a pseudo-element.


Top Tags