Anything wrong in code?
That's kind of a broad statement. What is it you want the code to do, and what is it the code is not doing?
There's actually a lot wrong with that code :
1a) You call al_flush_event_queue on an uninitialized event queue 'q'.
1b) You query (call al_get_next_event on) an uninitialized event queue 'q'.
2) Your indentation is still wrong - 3 spaces per indentation level is usually agreeable with most people.
3) You never allocate memory for 'filename'.
4) You never use the variable 'string'.
5) get_ascii_value doesn't return any value if the conditions aren't met.
Isso é uma espécie de afirmação abrangente. O que é que você quer o código para fazer, e qual é o código não está fazendo?
Na verdade, há muita coisa errada com este código:
1a) Você chama al_flush_event_queue em 'q' uma fila de eventos não inicializado.
1b) Você al_get_next_event (consulta chamar) 'q' uma fila de eventos não inicializado.
2) O recuo ainda é errado - 3 vagas por nível de recuo é geralmente agradável, com a maioria das pessoas.
3) Você nunca alocar memória para 'filename'.
4) Você nunca usa 'string' variável.
5) get_ascii_value não retorna nenhum valor se as condições não são cumpridas.
To the person can type a text on the screen and you can save the file with the name typed
The recue is the space of "}" ?
I'll try to fix errors! Thanks!
To the person can type a text on the screen and you can save the file with the name typed
I actually understand what you are trying to do with the code. Try to fix the errors I mentioned, and then tell me what is not working.
Eu realmente entendo o que você está tentando fazer com o código. Tentar corrigir os erros que eu mencionei, e depois me diga o que não está funcionando.
The recue is the space of "}" ?
This did not translate well. I don't understand what you are saying. Use Google translate to translate it from portugese to english for me.
Isso não traduzem bem. Eu não entendo o que você está dizendo. Use o Google translate para traduzir de português para Inglês para mim.
You say: 2) Your indentation is still wrong - 3 spaces per indentation level is usually agreeable with most people.
The indentation that you mention is related with the "}" of the code?
Yes, every time you use an if statement or else if statement or create a new block of code with a bracket ({) you should add an indentation level. Every time you close one of those statements you should remove an indentation level. Whether you use 2, 3, 4, or even 8 spaces for each level is up to you. Just be consistent :
Sim, toda vez que você usar uma instrução if ou então se ou criar um novo bloco de código com um suporte ({), você deve adicionar um nível de recuo. Toda vez que você fechar uma dessas demonstrações que você deve remover um nível de recuo. Se você usar 2, 3, 4 ou mesmo 8 espaços para cada nível é até você. Basta ser coerente:
Your IDE should do all this for you when you press tab. What IDE are you using? Code::Blocks?
O IDE deve fazer tudo isso para você quando você pressiona tab. Qual IDE você está usando? Code:: Blocks?
I understand now... Yeah I'm using code::blocks
If you have any more questions / problems let me know.
al_flush_event_queue(event_queue);
(Remove events of the queue!)
if(al_is_event_queue_empty(event_queue)) {
(If queue specified is currently empty, You have nothing typed yet, so is empty?)
if(al_get_next_event(event_queue, &ret_event)) {
(To get the next event, typed text or something else.)
This line of reasoning is correct?
I'm not sure what you're asking me. The way you did it before was fine :
if (!al_is_event_queue_empty(event_queue)) { ALLEGRO_EVENT ev; while (al_get_next_event(event_queue , &ev)) { ///..... } }
EDIT 1: I tried but could not develop the function to write on the screen, but practicing with the code below I managed to make the file that is loaded into the console open on one screen with the display function, I'll try to draw something to discover out if it really worked.
hun... thanks!
To run the code in the console ... I got more or less what I want!
Look!
EDIT 1: I tried but could not develop the function to write on the screen, but practicing with the code below I managed to make the file that is loaded into the console open on one screen with the display function, I'll try to draw something to discover out if it really worked.
I'm not sure what you're asking. What do you mean 'write on the screen'?
The things that I type in keyboard appear on the screen.
You need to look for CHAR events to do this.
link
@@"
I thought you already had on screen input working in another thread. It's not working now?
Eu pensei que você já tinha na entrada da tela de trabalho em outro segmento. Não está trabalhando agora?
It's no possible to type
I replied to your other thread.