====== SIF Questionnaires ======

A SIF (//Synchronet Interface File//) is a text file with a small structured format that drives interactive prompts in the BBS. The most common use is the **new-user questionnaire** — a sysop-defined set of questions presented to users on first logon, with the answers stored in their account record for the sysop to review later.

SIF files live in the [[:dir:text]] directory with a ''.sif'' extension. The file ''[[:dir:text]]/example.sif'' ships with Synchronet as a reference for every supported syntax element.

===== How SIFs are used =====

==== New-user questionnaire ====
Configured in [[util:scfg|SCFG]] → System → New User Values:

  * **Input SIF Questionnaire** — file (without ''.sif'' extension) presented to new users on first logon. If a user does not yet have stored answers, they receive this questionnaire automatically.
  * **Output SIF Questionnaire** — an //optional// abbreviated SIF used when a sysop reviews a user's answers. The output SIF should match the input SIF in structure (same fields, in the same order); only the displayed prompt text needs to differ. If no output SIF is configured, the input SIF is used for review.

The sysop reviews a user's answers from the [[access:user_editor|in-BBS User Editor]] with the ''#'' command.

==== Ad-hoc SIFs ====
Sysops can run any SIF on demand with the '';SIF'' [[module:str_cmds|string command]] from the main prompt (enter the filename without the ''.sif'' extension).

===== File format =====

A SIF is a plain text file. Only text **between an STX (Ctrl-B / ASCII 2) and an ETX (Ctrl-C / ASCII 3)** is presented to the user; everything else is treated as comments. After each ETX, a compact field specifier defines the input mode for the next answer.

==== Field specifier ====
<code>
<STX> prompt text <ETX>mode[mod][l][r][x][.n]["str"]
</code>

^ Element ^ Meaning ^
| ''STX'' | ASCII 2 (Ctrl-B). Marks start of displayed prompt text. |
| ''prompt text'' | Any number of ASCII characters, [[ctrl-a_codes|Ctrl-A codes]] supported. |
| ''ETX'' | ASCII 3 (Ctrl-C). Marks end of displayed prompt text and start of the input specifier. |
| ''mode'' | Required. ''c'' = single character, ''s'' = string. |
| ''mod'' | Optional mode modifier: ''n'' = numeric only, ''u'' = uppercase, ''f'' = forced word capitalization (string mode only). |
| ''l'' | Display an inverse-color input bar of the maximum length. |
| ''r'' | Append a CR/LF to this field in the stored data buffer. Only useful for buffer/file readability — without it, all answers run together on one line. |
| ''x'' | Maximum string length. Required for non-template ''s'' mode. |
| ''.n'' | Minimum string length (string mode only). |
| ''"str"'' | In ''s'' mode: a template defining input shape. Characters ''N'' (numeric), ''A'' (alphabetic), or ''!'' (any) accept user input; all other characters are printed literally. Common templates: ''"NNN-NNN-NNNN"'' (phone), ''"NN/NN/NN"'' (date). \\ \\ In ''c'' mode: the set of acceptable characters (case-insensitive), e.g. ''"ABC"'' for a multiple-choice answer. When specified in ''c'' mode, ''u'' and ''n'' modifiers have no effect; input is uppercased automatically. |

==== Examples ====

**Uppercase string, 3-8 chars, with input bar and trailing newline:**
<code>
<STX>Enter string: <ETX>sulr8.3
</code>
Prints ''Enter string: '' followed by an 8-cell input bar, uppercases all input, accepts 3-8 characters, appends CRLF.

**Multiple choice:**
<code>
<STX>
A> First Answer
B> Second Answer
C> Third Answer
Which: <ETX>c"ABC"
</code>
Prints the menu, accepts exactly one of ''A'', ''B'', or ''C''.

**Phone number with template:**
<code>
<STX>Enter phone number: <ETX>s"NNN-NNN-NNNN"
</code>
Prints the prompt, accepts only digits at the ''N'' positions, auto-skips the dashes.

==== Reference ====
See ''[[:dir:text]]/example.sif'' for an annotated working example covering every supported field type and modifier.

===== See Also =====
  * [[:custom:|Customization index]]
  * [[:custom:ctrl-a_codes|Ctrl-A Codes]] (for prompt formatting)
  * [[:dir:text]] (location of ''.sif'' files)
  * [[util:scfg|SCFG]] → System → New User Values
  * [[access:user_editor|In-BBS User Editor]] (''#'' command to review answers)
  * [[module:str_cmds|;SIF string command]]

{{tag>sif questionnaire newuser}}
