Jump to content
Registration disabled at the moment Read more... ×

Freeeee

Members
  • Content Count

    39
  • Joined

  • Last visited

Everything posted by Freeeee

  1. nope. did you try it? I just added the code the move from Tlabels to Tmemo still doesn't work first line is missing on move back. ??
  2. thanks. that was my question. "is there a procedure/function that makes sure there are enough lines?" Nice bit of succinct code too. 🙂
  3. Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Button1: TButton; Button2: TButton; memo1: TMemo; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin // FROM LABELS this does not work reliabley Memo1.lines.delete (0); // will cleaning help? Memo1.Lines.Delete (1); // nope each B1 clk removed memo1.lines.Delete (2); // another line. Memo1.lines [0] := Label1.caption; Memo1.lines [1] := Label2.Caption; Memo1.lines [2] := Label3.caption; end; procedure TForm1.Button2Click(Sender: TObject); begin // FROM MEMO LINES this works Label1.caption := Memo1.lines [0]; Label2.Caption := Memo1.lines [1]; Label3.Caption := Memo1.lines [2]; end; end.
  4. This is interesting. The move from the TMemo to the Tlabels works fine. Every time. too. Actually there are 14 lines in the TMemo in the 'real' program. The example I used was from a test program. Three seemed like enough. It's moving the same labels (all 14 of them) in the same program back into the TMemo for editing. a ?? second later?? that doesn't work. where did the TMemo lines go? Hitting the button that does the move from TLabel to TMemo several times seems to 'use up' Lines until there's only 1 left. Does moving lines To a TMemo, from the Tlabels, make the number of lines available smaller? Why? That doesn't make much sense. typing into the TNemo from the keyboard still works. is there a command to make sure the TMemo has 14 lines in it.??? I Thought from reading the description of TMemo, that the number of lines was more or less "Very" large. It says 'infinite' but that's a stretch.
  5. Thanks again Remy. as usual, your answer are precise and lead me to a better understanding of what's available. I had just discovered string grids, last nigh. 🙂 thinking there has to be a better way for Users to input names and dates. Do you know of a resource online where I could page thru the available resources.?
  6. Freeeee

    executing code at startup?

    Is there any way of running code at program start up. right now it looks like code only runs when you click on a control on the form. Is there any way of running code before you get to that point Example ap creates and Ini.file that records where you were at in the last time you used it. is it possible to read the ini file without having to click on something in the form when the form appears?? If so, where do you place that code? Does it need to be a procedure? Does it have to have a 'special' name?
  7. Freeeee

    executing code at startup?

    Thanks what I needed.
  8. type TForm1 = class(TForm) TForm2 = class(TForm) ....... private { Private declarations } public { Public declarations } end; var Form1: TForm1; Form2:TForm2; doesn't work BUT if you put the Type and Var statements + an 'end' under "private'" or "public" it does compile.
  9. Freeeee

    can a single unit have more than 1 form?

    thanks The data modules are new since I last used Turbo Pascal & Delphi I'll look into it.
  10. Freeeee

    can a single unit have more than 1 form?

    the reason I'm doing that is I have 3 separate but related pre-existing direct access files that have to be kept in sync with each other. I need 3 different forms in one program to do that. So rather than "Don't Do That" what do you suggest? we could to e-mail if you';d rather to keep the subject out of the forum but that seems to be contrary to the Forum concept. I'm perfectly happy to have multiple units (dot pas files) and then use the USES statement to collect them into 1 executable. I did that years ago using Turbo Pascal and Delphi version? without much of a problem. That code is corrupted or missing now. and it only ran on 16 bit DOS or WIN 3 But the files are still intact. I'm trying to update it to a 64 bit world.
  11. Freeeee

    can a single unit have more than 1 form?

    so I'd replace the *.DFM with specific, named dot DFM files? by the way, that statement looks like a comment. or is it a directive like {$-} and {$+} around I/O statements? Or would I use the USE unit2, unit3, etc?? to gather the files. Is there some where I can look this stuff up in an Index?
  12. Freeeee

    can a single unit have more than 1 form?

    thanks. I was coming to that conclusion. having a IDE designed around a forms design screen without allowing multiple forms seems like a bad idea. I programmed in Turbo pascal on DOS and Win3 years ago and Delphi seemed to be a better product then. much easier to use. Am I correct in that that the 2nd and other forms have to go into either the public or private sections?
  13. Freeeee

    Freeeee

    I have two units (1 & 6) with associated Forms 1 is the stratup form. I want a button on that form to close form 1 and open form 6 for further input. I need to call a procedure in from 6 after the button is triggered to use a file write routine in form 6 before (or as) closing form 1 and opening form 6. How do I do this? Sounds simple but I haven't found a tutorial or book that shows the code yet. I know the code goes into the buttonclick procedure and I have found the USES clause for Form 6 but making the transfer from 1 to 6??? not yet.
  14. Freeeee

    Freeeee

    thanks... very much. It worked just fine with a few minor adjustments. I used Hide on form1 because it was/is the main form and didn't need the Action on form6. It would seem like a simple thing to do but I couldn't find that bit of info any where. Do you know Cathy Henley?
×