357mag
Members-
Content Count
90 -
Joined
-
Last visited
Community Reputation
2 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
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.
-
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.
-
You are way ahead of me. I have not studied functions or procedures yet. Can you write out the code?
-
Oh...I fixed it. It's working now.
-
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;
-
I got it working now. I forgot to include sLineBreak.
-
It still is printing on the same line.
-
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.
-
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);
-
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?
-
Okay I got it working now.
-
That won't work either. Compiler says "undeclared identifier."
-
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;
-
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.
-
Okay I found out how to do it.