Jump to content

357mag

Members
  • Content Count

    66
  • Joined

  • Last visited

Everything posted by 357mag

  1. 357mag

    How do I convert from string to char?

    Your first code example does not work. C++ Builder wrote an extremely long line complaining about something. It also said chValue is assigned a value that is never used. Your second code example worked though.
  2. 357mag

    Delphi says "x is not a valid integer value"

    You guys are acting like jerks. I'm talking about a different piece of code now. If you can't or don't know how to be nice and respectful, then please go to bed. In C++ you can assign a value to a variable immediately after declaring it. Delphi would not let me do that. I had to assign the values to the variables further down underneath the begin keyword.
  3. 357mag

    Delphi says "x is not a valid integer value"

    You guys are acting like jerks. I'm talking about a different piece of code now. If you can't or don't know how to be nice and respectful, then please go to bed.
  4. 357mag

    Delphi says "x is not a valid integer value"

    How come you can't assign a value to a variable in the same section you declared it? You gotta assign the value underneath the begin keyword instead.
  5. 357mag

    I've got to clean this up

    So I'm just getting started with Delphi and I went into Options -> Environment Options and under the Default Project list box I told it to save my files to D:\Delphi Programming Projects. In that folder I have two subfolders, one called Console Projects and the other called Windows Projects. I wrote a project today and when I was done I hit Save Project As... and it prompted me to give the unit file a name which I did and a project file a name which I did. And I directed Delphi to the exact folder (which is called Welcome Program) to save the files in. Problem is Delphi also save files and a Win32 folder in the Delphi Programming Projects folder. I need to save everything to the Welcome Program folder, so I don't have files scattered in the Delphi Programming Projects plus the Welcome Program folder too. I can understand why it did that because after all I told Delphi in Environment Options to use the D:\Delphi Programming Projects folder as a default directory. But isn't there a way to get Delphi to put everything in a subfolder? Like in my case the name of my program is Welcome Program. I want everything going into that subfolder. I've enclosed a screenshot.
  6. 357mag

    I've got to clean this up

    What I may need to do is as soon as I have a new Project open save the Project right away in the specific folder that I want. That way Delphi won't have much chance to do something behind my back.
  7. 357mag

    I need to clear my Label

    Does not seem that Delphi has a Clear() method. So I figure I got to use the quotation marks. But this is not working: LabelGreeting -> Caption := "";
  8. 357mag

    I need to clear my Label

    It took awhile but I got it figured out. You got to use single quotation marks, not double.
  9. Visual Studio has a property for the Form that specifies start up position on the screen. I select Center Screen with that. I'm looking for something similar to that using Delphi. So my program runs in the center of the screen instead of off to one side.
  10. Okay I found it. I neglected to click on the Form first to see all the properties.
  11. Trying out RAD Studio 11 and when it come up the Welcome page says "error loading data." Did some research on this and they say to run GetItCmd.exe -c=useoffline so I run that command in a command window and it successfully went but the error messages remain there.
  12. 357mag

    What is with this errors on the Welcome Page

    There is no startpage etc. listed in the registry on mine. So I deleted everything that said Welcome Page but now I'm getting some errors in the IDE. I tried the -np after the bds.exe on the command line and it worked. The Welcome Page did not show.
  13. 357mag

    How many people use Delphi?

    I'm thinking I may start working with it soon. I'm just a hobbyist when it comes to programming, and I've had some fun doing it.
  14. I was doing my empty string things wrong. I used to think that "" and " " meant the same thing. I just learned they don't. To make an empty string you do "" with the quotation marks close together. Where as the " " means the space character which has an ASCII code of 32. Does C++ Builder have a Clear() method like C# does? So if I didn't want to do this: labelAnswer.Text = "" I could use a Clear() method: labelAnswer.Clear() Something like that anyway.
  15. 357mag

    Does C++ Builder have a Clear() method?

    I did not see anything about a Clear method so I guess I would have to use Edit1 -> Text = "".
  16. 357mag

    How do I convert from string to char?

    I mean my Clear button looks like this: EditCharacterEntry -> Text = " "; EditCharacterEntry -> SetFocus(); Don't know how that "is 32" thing got in there before.
  17. 357mag

    How do I convert from string to char?

    Well it appears to be working now. All I did to the Clear button was this: void __fastcall TFormCharacterValues::ButtonClearClick(TObject *Sender) { EditCharacterEntry -> Text = " "; LabelAnswer -> Caption = " "; EditCharacterEntry -> SetFocus(); }
  18. 357mag

    How do I convert from string to char?

    I noticed that if I hit the Clear button, that is when the output is wrong. If I don't hit the Clear button, then the output is correct: A is 65 B is 66 C is 67
  19. 357mag

    How do I convert from string to char?

    Don't know what's wrong because I'm getting garbage values in my LabelAnswer. I even get a graphic of a tiny square in the output. I want the output to be like this: A is 65 B is 66 Here is my code: int chValue = 0; AnsiString myString; Char ch = EditCharacterEntry -> Text[1]; chValue = static_cast<int>(ch); LabelAnswer -> Caption = ch + " is " + chValue; Sometimes the output will be correct, like if I enter 'A' it will say 'A' is 65. But other times it just says "is 32".
  20. 357mag

    How do I convert from string to char?

    That article doesn't help a beginner hobbyist.
  21. I'm kinda confused about how to save a project in C++ Builder. I mean in the File menu there is four options: Save Save as Save project as Save all So lets say I have started a new project (a Windows project, not console). So I'm working with a Unit file and a header file and whatever else. How do I save everything? I know that if I wanted to save the project under a different name than I gave it originally, I would use Save project as. Or I suspect if I wanted to save just one file under a different name, I would use Save as. But what is the difference between Save and Save all? How do you guys do it? And should I save the project right away after seeing Form1 come up on the screen? Or should I save the project after I'm done working on it for the day? But I've had problems in this area that's why I'm asking.
  22. I need to print these lines on separate lines. So each output is on a new line. Don't know where I'm going wrong but right now it's doing this: The value of count is 0The value of total is 5 My code is this: int count; int total; count = 5; total = 0; EditResults -> Text = EditResults -> Text + "The value of count is " + IntToStr(count) + "\r\n"; EditResults -> Text = EditResults -> Text + "The value of total is " + IntToStr(total); // total = ++count + 6; // EditResults -> Text = EditResults -> Text + "\r\nThe value of count is " + count; // EditResults -> Text = EditResults -> Text + "\r\nThe value of total is " + total; I've commented out the last three lines until I figure out what's wrong. I'm using an Edit box and I looked for a multi-line property but none is listed.
  23. Ha! I got it figured out! You have to go into Lines and then delete those words in the String List Editor. Works good now.
  24. My program runs correctly now, but for some odd reason when I hit Run in the Memo box the words (what I used to name the Memo control) say "MemoResults". How do I get rid of those words? I don't want those words in there.
  25. How do I make small, fine adjustments to the components in C++ Builder? Like if I have a Label selected, how do I relocate it using small adjustments? I know in Visual Studio you use the arrow keys.
×