Skip to content

Commit

Permalink
getch not work will with readln
Browse files Browse the repository at this point in the history
i have bug in #4 when repeat compile it
  • Loading branch information
zaher committed Jan 15, 2015
1 parent 32bd9b5 commit eaba474
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ i := i + 5.5;
else {
write("Enter test source #");
string answer;
answer = readln();
answer = trim(readln());
if (answer =="") {
loop = false;
break;
}
int i = to!int(answer.trim());
int i = to!int(answer);
source = sources[i];
}
writeln();
Expand All @@ -219,15 +219,17 @@ i := i + 5.5;
writeln("---------------");
sard.compile(source);
writeln();
writeln("Press enter to run");
// writeln("Press enter to run");
//getch();
readln();
//readln();
writeln("----- Run -----");
sard.run();
writeln();
writeln("----- Result -----");
foreground = Color.lightCyan;
string s = sard.result;
writeln(s);
foreground = Color.initial;
writeln();
}
writeln("---------------");
Expand All @@ -252,7 +254,7 @@ i := i + 5.5;
foreground = Color.initial;
}
writeln("Press enter to stop");
//getch();
readln();
getch();
//readln();
return 0;
}
2 changes: 1 addition & 1 deletion src/sard/process.d
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public:
}
result = stack.results.current.result.value.asText();
debug {
writeln("The value isssss: " ~ result);
writeln("The value is: " ~ result);
}
}
};
Expand Down

0 comments on commit eaba474

Please sign in to comment.