home *** CD-ROM | disk | FTP | other *** search
-
- The filters in a flowchart:
-
-
- ────> Input from modem ─┐ Output from door ──> modem
- │ ^
- v │
- Input filter Output filter
- │ ^
- │ │
- └──> your door ─>────┘
-
-
-
-
- The input and output filters.
-
- The input filter basicly checks if the character in the input stream is legal.
- this way you can avoid control-characters and such. It's defined in FOSSIL.PAS
- as a Set of Char.
-
- The output filter is more complex. It takes the output and parses the special
- characters. F.e. if you use the command
-
- Foss.WriteLnF('^0Hello world, this is a ^2RADOOR 3.0^0 door.");
-
- It finds the ^0 metacharacter, looks up the colorvalue 0 in the colortable,
- and translates this colorvalue into the ANSI or AVATAR sequence. It also tries
- to be smart, so if the background color is already black, it's not set to
- black again. If the user doesn't use ANSI or AVATAR, the code is stripped.
-
- This way of working makes colors and such completely transparant to the
- program. An other thing the output filter does is translating the ClearEOL
- into the ANSI or AVATAR sequence, translating the brackets if RA is used and
- converting high ascii to low ascii for users without ansi or avater (which
- are supposed to have non-IBM machines)
-
- You can use every character you like in your program, if the user can't handle
- it (and doesn't select avatar or ansi) it is translated or replaced by a space.
- Line's are converted to +|-, special characters loose their accent, and the
- "■" which is often used as attention mark is translated into a star.
-
- There is only one but at this moment. Clear until end of line.... Since there
- is no way for the filter unit to know where it is on a line when the user
- doesn't has ansi or avatar, the filter sends 80 spaces and a carriage return.
- So the clear until the end of a line you have two choices:
-
- - handle it from within the main program
- - make sure the cursor is at the beginning of the line.
-
- Personaly I usely do the last using commands like:
-
- Foss.WriteF(#13'^!^0your choice: ^2');
-
- which first gives the #13 Carriage return, and then clears the line.
-