Manual:DIL Manual/excmdstr case
Jump to navigation
Jump to search
Contents
excmdstr_case
Variable (string, read-only).
excmdstr_case : string
The first word of the line the player typed, exactly as typed: Mellon stays "Mellon". Otherwise the same as excmdstr: ' gives "say", , gives "emote", and it is null outside a typed command.
Notes
- Use it where case matters, such as a password typed at a prompt: commands.zon's password command reads it after
wait(SFB_CMD, self == activator)andblock. ==on strings ignores case, soexcmdstr_case == "Mellon"is also true formellon. For an exact match usestrcmp(excmdstr_case, "Mellon") == 0.- Only the first word: the rest of the line is in
argument, which keeps its case. - Like excmdstr it belongs to the command: an exec() of the same command while handling it leaves it null. Copy it first.
Example
dilbegin secret_word();
var
word : string;
code
{
sendtext("Speak the word, exactly as it is written: ", self);
wait(SFB_CMD, activator == self);
block;
word := excmdstr_case;
if (strcmp(word, "Mellon") == 0)
sendtext("The doors swing open.<br/>", self);
else
sendtext("Nothing happens.<br/>", self);
quit;
}
dilend
Asks the player for a word and accepts only Mellon with that capital letter. The block keeps the word from running as a command.