✅ when programming a CLI in C#...

1. how can i open my own CLI window like how starting the python repl works? 2. how can i take input with a string predecessor? i want to do >>> ... but there isnt a way to get an input on the same line as text, as far as ive seen
10 Replies
reflectronic
reflectronic6mo ago
what do you mean by opening your own CLI window if you write a console program, when you open it, it opens a new console window it just does that Console.Write(">>> "); var i = Console.ReadLine();
slowly losing it
slowly losing itOP6mo ago
readline reads the NEXT line not the same line that would do
>>>
...
>>>
...
i want to do
>>> ...
>>> ...
reflectronic
reflectronic6mo ago
No description
slowly losing it
slowly losing itOP6mo ago
OHH .Write i thought you said .WriteLine() apologies
TizzyT
TizzyT6mo ago
1) install the global tool C# repl: https://github.com/waf/CSharpRepl 2) Console.ReadLine() returns the user input line
GitHub
GitHub - waf/CSharpRepl: A command line C# REPL with syntax highlig...
A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively. - waf/CSharpRepl
slowly losing it
slowly losing itOP6mo ago
i dont think that was my question how does this relate, if i may ask?
TizzyT
TizzyT6mo ago
You didn't ask to run a C# Repl "like starting a python repl"?, I may have misunderstood if not.
slowly losing it
slowly losing itOP6mo ago
oh sorry for the misconception i meant taking input on the same line as where you've written text to the console
TizzyT
TizzyT6mo ago
Ah, gotcha. Apologies
slowly losing it
slowly losing itOP6mo ago
no problem alr solved

Did you find this page helpful?