SRL Archive - Research & Development Lounge

Intresting idea..


Fitta

2014-09-06 12:15:37

Quick test script..

You could have as many options as you'd like.. Creative people will understand the possibilities.

Just a few things
  • NextPlayer(True);
  • Respond without pausing the script
  • change any variable
  • breaks when told



program TestIdea;
{$I SRL-OSR/SRL.Simba}

const
input_FKey = 5;

var
Test: Integer;

function Left(str: string; x: Integer): string;
var
l: Integer;
begin
l := Length(str);
if ((x > 0) and (l > 0)) then
Result := Copy(str, 1, x);
end;

Procedure HandleCheck(S: String);
var
commandS, ExecuteS: String;
begin
CommandS := Left(S, PosEx('?', S, 1));

Case CommandS of
'test?': Test := StrToIntDef(Between('?', '!', S), -1);
end;
end;


Procedure input_Check;
var
S: String;
begin
If not IsFKeyDown(input_FKey) then
Exit;

InputQuery('Enter input', 'Input valid string: ', S);
HandleCheck(S);
end;

begin
repeat
Writeln(Test);
input_Check;
Wait(100);
Cleardebug;
until(False);
end.

Edit: Forgot.. Input "test?5!" or any other number for that matter..

tls

2014-09-07 04:06:22

Didn't we have something like this in the old srl include?