home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / FILTER.DOC < prev    next >
Encoding:
Text File  |  1992-02-12  |  2.3 KB  |  56 lines

  1.  
  2. The filters in a flowchart:
  3.  
  4.  
  5. ────> Input from modem ─┐            Output from door ──> modem
  6.                         │                    ^
  7.                         v                    │
  8.                    Input filter         Output filter
  9.                         │                    ^
  10.                         │                    │
  11.                         └──> your door ─>────┘
  12.  
  13.  
  14.  
  15.  
  16. The input and output filters.
  17.  
  18. The input filter basicly checks if the character in the input stream is legal.
  19. this way you can avoid control-characters and such. It's defined in FOSSIL.PAS
  20. as a Set of Char.
  21.  
  22. The output filter is more complex. It takes the output and parses the special
  23. characters. F.e. if you use the command
  24.  
  25.     Foss.WriteLnF('^0Hello world, this is a ^2RADOOR 3.0^0 door.");
  26.  
  27. It finds the ^0 metacharacter, looks up the colorvalue 0 in the colortable,
  28. and translates this colorvalue into the ANSI or AVATAR sequence. It also tries
  29. to be smart, so if the background color is already black, it's not set to
  30. black again. If the user doesn't use ANSI or AVATAR, the code is stripped.
  31.  
  32. This way of working makes colors and such completely transparant to the
  33. program. An other thing the output filter does is translating the ClearEOL
  34. into the ANSI or AVATAR sequence, translating the brackets if RA is used and
  35. converting high ascii to low ascii for users without ansi or avater (which
  36. are supposed to have non-IBM machines)
  37.  
  38. You can use every character you like in your program, if the user can't handle
  39. it (and doesn't select avatar or ansi) it is translated or replaced by a space.
  40. Line's are converted to  +|-, special characters loose their accent, and the
  41. "■" which is often used as attention mark is translated into a star.
  42.  
  43. There is only one but at this moment. Clear until end of line.... Since there
  44. is no way for the filter unit to know where it is on a line when the user
  45. doesn't has ansi or avatar, the filter sends 80 spaces and a carriage return.
  46. So the clear until the end of a line you have two choices:
  47.  
  48.  - handle it from within the main program
  49.  - make sure the cursor is at the beginning of the line.
  50.  
  51. Personaly I usely do the last using commands like:
  52.  
  53.  Foss.WriteF(#13'^!^0your choice: ^2');
  54.  
  55. which first gives the #13 Carriage return, and then clears the line.
  56.