Jump to content

357mag

Members
  • Content Count

    91
  • Joined

  • Last visited

Everything posted by 357mag

  1. 357mag

    This is a change

    In previous versions of C++ Builder, I remember having to use the include<conio.h> header file. Plus to keep the console window open I had to put getch() at the end of my source file. Now I just copied a .cpp file which was made in Visual Studio, and I pasted it into a source file in C++ Builder. I didn't think it would run, but it did with no complaints from the compiler. I did not include the <conio.h> file nor did I have to place a getch() at the end. C++ builder simply ran the file just fine. Did Embarcadero change some things? I'm using the Community Edition 12.
  2. 357mag

    This is a change

    There is no code that behaves differently.
  3. I'm considering working in Delphi for awhile, and I was looking through my books (I have four of them), and every book starts off right away with Windows programming. None of the books teaches you console programming. Personally, I like console programming. I was wondering if there is a reason all of my books starts you off that way. Perhaps because Delphi is a clean, fairly easy to grasp language?
  4. I'm working on a program using Logical Operators, and everything is working fine, except for one line that the compiler says it's incompatible types. It's a bit messy to look at also, but it works. And is there a way to tell Delphi to print the words true and false instead of the integer values -1 and 0? The line that is not correct yet is the fifth line down (the MemoResult lines) the one where I'm using the not operator. I don't know how best to write it. Here is my code: procedure TFormLogicalOperators.ButtonOKClick(Sender: TObject); var a: boolean; b: boolean; begin a := true; b := false; MemoResult.Text := ('a: ' + BoolToStr(a)) + sLineBreak; MemoResult.Text := MemoResult.Text + ('b: ' + BoolToStr(b)) + sLineBreak; MemoResult.Text := MemoResult.Text + ('a and b: ' + BoolToStr(a and b)) + sLineBreak; MemoResult.Text := MemoResult.Text + ('a or b: ' + BoolToStr(a or b)) + sLineBreak; MemoResult.Text := MemoResult.Text + ('not a: ' + BoolToStr(not (a + b))) + sLineBreak;
  5. 357mag

    One line of code not quite right

    Where do you place the function header? Calling a function that is already defined somewhere is one thing. Declaring or defining it is another. I may have to come back to this program later on.
  6. 357mag

    One line of code not quite right

    You are way ahead of me. I have not studied functions or procedures yet. Can you write out the code?
  7. 357mag

    One line of code not quite right

    Oh...I fixed it. It's working now.
  8. I have a program and there is a Edit box and a few buttons. When the program is run, I want to be able to press a button called Show Values and then you will see two lines of code: The value of x is: 6, and The value of y is 7. But I want each line to print on a new line. So I put an sLineBreak in there but it's not working. The second line is just printing after the first line. It should look like this: The value of x is 6 The value of y is 7 Here is my code so far: procedure TFormIncrementAndDecrement.ButtonShowValuesClick(Sender: TObject); var x, y: integer; begin x := 6; y := 7; EditResult.Text := 'The value of x is: ' + IntToStr(x) + sLineBreak; EditResult.Text := EditResult.Text + 'The value of y is: ' + IntToStr(y);
  9. 357mag

    My sLineBreak is not working

    I got it working now. I forgot to include sLineBreak.
  10. 357mag

    My sLineBreak is not working

    It still is printing on the same line.
  11. 357mag

    My sLineBreak is not working

    Thank You, that is working much better. But when I run my program the words MemoResult show in the Memo control. How do I get rid of them? I've looked in the Object Inspector and I don't see a way to remove them from the Memo contol.
  12. Is there a page out there somewhere that shows some naming conventions for the controls in C++ Builder? Like how do you abbreviate things like the Edit box or the Label etc? Do you just follow Visual Studio conventions? Just wondering what would be some good naming abbreviations.
  13. I'm using a regular Label currently to store the sum of some addition, but the book I'm working out of shows the Label sunken in a little bit. It's not perfectly flat like a regular Label is. It has a real shallow depression in it. What is the name of this control?
  14. I wrote a very simple program that asks the user to enter an integer. When I was writing the code for the Quit button, I saw a flashing word on the screen, below all the code. This word flashes just for a brief second and then goes away. It looks like the word is calculating... Is this a bug?
  15. 357mag

    Why doesn't this work?

    I've got a program that asks the user to enter the name of a boy, and the name of a girl. Then he clicks on the Add Couple button, and the boy and girl are added to a listbox together. They're going to a dance together. But the compiler will not let me list the variables on individual lines. It will only list my variables on one line. Even my book says you can also write it like this. This does not work: procedure TFormStringConcatenation.ButtonAddCoupleClick(Sender: TObject); begin Var Boy: string; Girl: string; Couple: string; Boy := EditEnterBoy.Text; Girl := EditEnterGirl.Text; Couple := Boy + ' and ' + Girl; ListBoxCouple.Items.Add(Couple); This however does work: procedure TFormStringConcatenation.ButtonAddCoupleClick(Sender: TObject); begin Var Boy, Girl, Couple: string; Boy := EditEnterBoy.Text; Girl := EditEnterGirl.Text; Couple := Boy + ' and ' + Girl; ListBoxCouple.Items.Add(Couple); end;
  16. 357mag

    Why doesn't this work?

    Okay I got it working now.
  17. 357mag

    Why doesn't this work?

    That won't work either. Compiler says "undeclared identifier."
  18. 357mag

    The menus are frozen

    I was experimenting which how to change the forecolor (the text), how to change the color of the text in a label, and all the menu items are frozen. When I click on them nothing happens at all. Now they are working again. Don't know.
  19. On the Welcome Page when you have Delphi open, there is an area that says Recent Projects. Okay that's fine, but is there a way to clear the list?
  20. 357mag

    How to clear the recent projects list

    Okay I found out how to do it.
  21. 357mag

    What is this flashing message doing there?

    I tried very hard to capture a screenshot but to no avail. But the message definitely says calculating... I'd like to report it to Embarcadero but I'm sure they too would ask me for a screenshot. Without that I don't know what they could even do about it.
  22. 357mag

    What is this flashing message doing there?

    I don't think I can capture a screen shot because it's quite fast. I'll try anyway though. I'm using the Community Edition. 12 Version 29.0.51961.7529. I'm seeing the flash in the code editor. Really strange and I'd like to get rid of it.
  23. I'm using the Community Edition of C++ Builder, and when I start the software up the first thing it shows is the Welcome Page. I'd rather not have that so is there a way to disable it?
  24. 357mag

    How do you shut off the Welcome Page?

    I got it going now. I completely removed the background image. So now it's a plain looking background image. Not even a gradient color either. Looks quite a bit better.
  25. 357mag

    The Red Arrow

    There is a red arrow pointing downwards next to the return statement. Never seen this before. Why is it there?
×