Solved

problem with forms

Posted on 1999-01-23
6
125 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
  • 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now