Solved

problem with forms

Posted on 1999-01-23
6
131 Views
Last Modified: 2010-04-06

Hi experts,

with the help of the menu-editor I created
a menue with the entry "File/New".

To this event I assigned this procedure:

procedure TfrmMainMenu.InputDataClick(Sender: TObject);
begin
frmEntryForm.showmodal;
end;

The EntryForm which now is displayed on the screen
contains several editboxes which can be filled by the user at runtime.
In order to finish the filling of the EntryForm I added one command button
and a savedialog control to my EntryForm.
If you click on the button, the program asks for a filename, to which all
contents of my editboxes will be written:

procedure TfrmEntryForm.ButtonSaveDataClick(Sender: TObject);
var
  f: textfile;
 begin
  repeat
      if savedialog1.execute then
      begin
        assignfile(f, savedialog1.filename);
        rewrite(f);
        writeln(f, tedit1.text');
        writeln(f, tedit2.text');
        closefile(f);
      end;
  until (messagebox(0, 'Do it again ?', 'Question', 36) <> 6);
frmEntryForm.close;
end;

Now my problem is: I can only once fill the editboxes of this EntryForm.
As soon as the repeat-until loop is processed the second time, I am only prompted for a filename.
In the background I still can see the EntryForm, but I have no possibility to input new data to
the editboxes.

Can you please tell me how I can avoid this problem ?

With kind regards

Mathes
0
Comment
Question by:mathes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1362990
What exactly are you trying to avoid?

Are you trying to hide the form, or you are trying to input some data?
0
 
LVL 17

Accepted Solution

by:
inthe earned 20 total points
ID: 1362991
i just changed a couple of lines and it works ok.
hope it's what you needed
Regards Barry

procedure TForm1.Button1Click(Sender: TObject);
var
  f: textfile;
 begin

      if savedialog1.execute then
      begin
        assignfile(f, savedialog1.filename);
        rewrite(f);
        writeln(f, 'edit1.text');
        writeln(f, 'edit2.text');
        closefile(f);
      end;
  if (messagebox(0, 'Do it again ?', 'Question', 36) <> 6)=true
  then
Form1.close;
end;
0
 

Author Comment

by:mathes
ID: 1362992
Hi experts,

thak you for your help. This is the solution. I was angry about the fact that I could only create one file during one session. Hiding a form was not a problem for me.

With kind regards

Mathes
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:viktornet
ID: 1362993
Hey Barry, how is ASm coming along? :-))

some more stars :))

¤¤¤ STARS ¤¤¤
0
 
LVL 17

Expert Comment

by:inthe
ID: 1362994
hi Viktor
not really doing much now ,takes too much time
im busy doing other stuff mainly delphi and java
for some projects for work.working on some shareware as well at the moment ,basic sys utils ya know.(like there's not a million out there already).wish i was born 10 years ago :-)

MODEL SMALL      
CODE
BEGINNING :      
      MOV AX,@DATA    
      MOV DS,AX
      MOV AX,OFFSET HEAD
      MOV AH,09
      INT 21H
      MOV CX,24
      MOV BX,OFFSET CHAIN
      XOR AL,AL
CYCLE :
      MOV AL,CL
      XLAT
      MOV DL,AL
      MOV AH,02
      INT 21H
      MOV DL,10
      INT 21H
      MOV DL,13
      INT 21H
      LOOP CYCLE
      INT 21H
      XOR BX,BX
      MOV AX,BX
      XOR DX,DX
      MOV AX,@DATA
      MOV DS, AX
      MOV DX, OFFSET TEXT
      MOV AH,9
      INT 21H
      MOV AX,4C00H
      INT 21H

DATA
      
      DB 13,10
      CHAIN DB "_8991 ereH saW yrraB. . . "
DATA
      TEXT DB " Hello it's going just fine thanks. ~0-0~ $"
      
STACK
END BEGINNING
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1362995
Well, I see you are doin' well :)) Keep up the good work.... I wish I was born 16 years ago :-)))
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question