public bool InputString([ByRef] IVariable resut, IValue prompt = null, IValue len = null, IValue multiline = null) { string input; bool inputIsDone; string strPrompt = null; int length = 0; bool flagML = false; if (prompt != null) { if (prompt.DataType != DataType.String) { throw RuntimeException.InvalidNthArgumentType(2); } strPrompt = prompt.AsString(); } if (len != null) { if (len.DataType != DataType.Number) { throw RuntimeException.InvalidNthArgumentType(3); } length = (int)len.AsNumber(); } if (multiline != null) { if (multiline.DataType != DataType.Boolean) { throw RuntimeException.InvalidNthArgumentType(4); } flagML = multiline.AsBoolean(); } inputIsDone = ApplicationHost.InputString(out input, strPrompt, length, flagML); if (inputIsDone) { resut.Value = ValueFactory.Create(input); return(true); } else { return(false); } }
public bool InputString([ByRef] IVariable resut, int len = 0) { string input; bool inputIsDone; inputIsDone = ApplicationHost.InputString(out input, len); if (inputIsDone) { resut.Value = ValueFactory.Create(input); return(true); } else { return(false); } }