I was wondering how to make a program that can output to every line of the console and not just output a line to be tacked on to the bottom. How can I get control of the whole console like that so I could write console based apps?
...
I have a piece of code that works fine in the console, but in a cron-driven rake task, it errors out every time, saying that the accessor function for one of the has_many relationships is not a valid method. Example:
provider has_many instances, so I'm calling provider.instances, and the rake task will throw back an error:
"undefined m...
Ok, I know that OpenFileDialogs needs STAThread, but i want to start the form from a console application, so I create a Thread for the Form that way I can print things to the console while working with the form, the problem is that if I want to use OpenFileDialogs then I can not print to the console!
...
I'm trying to write a shell in Ruby, and to implement tab completion I am using the WinAPI function getch to read in a character at a time from the user, checking for tabs.
The problem with this is the backspace key:
It moves the cursor further back than the prompt (eg, with prompt hello> , the user can backspace the cursor on to the...
Hello,
I am writing some unit tests in ruby and have tests like the following:
def executing_a_signal
a_method(a_signal.new, a_model, a_helper);
assert_equal(new_state, a_model.state)
end
The tests work fine, but the method which runs just before the assertion to execute the logic prints various messages to the console (m...
Hello all,
I'm having a spot of trouble getting my python classes to work within the python console. I want to automatically import all of my classes into the global namespace so I can use them without any prefix.module.names.
Here's what I've got so far...
projectname/
|-__init__.py
|
|-main_stuff/
|-__init__.py
|-main1.py
|-ma...
How can I erase the current line printed on console in C ? I am working on a linux system
example -
printf("hello");
printf("bye");
I want to print bye on the same line in place of hello.
output
bye
...
We have an application that outputs logging info to stdout. However, if it is run in a command prompt window, you can use Mark to select text from the console. If you leave the text selected, the application just hangs and doesn't proceed, until you deselect the text (for example by pressing Enter to copy the selection into the clipboard...
while(ch != 'q')
{
printf("looping\n");
sleep(1);
if(kbhit())
{
ch = readch();
printf("you hit %c\n",ch);
}
}
This code gives me a blocking getch() like functionality. I am trying to use this code to capture up down arrow keys.
Added:
Trying to capture key codes of up arrow gives me 3 chars 27, 91 and 65.
Using i...
Hi I am using raw.c for keyboard capture. Following code finds when an arrow key/ esc is pressed. At the same time I want to read whole words that user inputs and these should be shown on stdout as well.
char pp = 0;
char p = 0;
while( (i = read(0, &c, 1)) == 1) {
if (pp == 033 && p == 0133 && (c &= 255) == 0102) /* DOWN */ break;
if (c...
Hello folks,
I am building a logic test suite using Xcode 3.1.4. I am able so far to build the test target and see the results inside de *.m test files as compiler errors (if they fail). The problem is that I can't see any information in the Debugger Console and I can't debug since the debugger does not work either.
1.How can I do to...
I'm trying my hand at c++ and am using fedora eclipse (3.4.2) as my IDE.
At the moment I'm trying to enter a string of numbers into the console, get the program to sort them and spit them back out. The program is straight out of a book and works with xcode and through a normal terminal - so I know it's correct.
Basically I run the prog...
Hello, I'm working on a project using Ogre3D. We recently ported our project to MacOSX but there are some things that were linked to the Windows API. In particular I don't know how this should be translated:
#if defined( __WIN32__ ) || defined( _WIN32 )
AllocConsole();
#endif
It would be nice to port the project under Linux someda...
Hello :)
I have a logger class that handles various information display with pretty colors (yay.). However, since it writes to the console in separated steps (i.e. set color to red, write text, set color to gray, write text, for something that would render "[Error] Description..." with the error being in red), but I have a multithreaded...
Related:
Should I include a command line mode in my applications?
How to grab parent process standard output?
Can a console application detect if it has been run from Explorer?
I want to build a console app, that is normally run from the command line.
But, when it is double clicked from within Explorer (as opposed to being r...
im currently using the SDL-devel-1.2.13-mingw32 library in code blocks 8.02. with the mingw 5.1.6 installed separately on C:\ this program compiles and runs with no errors but i can't see the last system("pause"); on the screen. When i press any key, it of course skips over the system("pause"); then code blocks tells me that it successfu...
Hi,
I found some source code in this thread posted by Rex Logan here on SO :
link text
... there's also some very interesting code posted in this same thread by Foredecker, but it is incomplete and complex : I'm not up enough on the 'Trace facility to know how to fully implement it ...
I am able to use this Console code Rex (kindly) ...
Say I allow the user to edit something, like the phone number in an Address Book (actually, that's exactly what I'm doing). Is there something that I can add to println that will allow me to insert a variable to display as fully editable text? The assignment that I'm doing this for doesn't actually call for this, but I think it would be ...
Using the example below, is it possible to send the result of the callback function to the console, i.e. the value being returned?
rows.sort(function(a, b) {
if(a.sortKey < b.sortKey) return -sortDirection;
if(a.sortKey > b.sortKey) return sortDirection;
return 0;
});
What would I use as the argument: console.log(?)
...
I need to read output from native C++ console application in my C++/.NET. There are many articles about this, but most wait until the process ends to read the output, which I don't want to, I need to read it immediately after it is "cout-ed" by the process (and don't want to block the GUI while doing so, but that's something I can do on ...