Solved

problem with forms

Posted on 1999-01-23
6
128 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 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