Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7004471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:12:12+00:00 2026-05-27T21:12:12+00:00

I grouped four radio buttons on the radiogroup. There are create file, create folder,

  • 0

I grouped four radio buttons on the radiogroup. There are create file, create folder, delete and copy radio buttons, but I am having a problem with the copy button.

It’s mostly working alright but the message window (saying where the file was copied to the hard drive) is not closing. How can i make it close? Or is there a way to refresh the radio buttons?

This is a homework problem.

Here is my code:

 procedure TForm1.btnsubmitClick(Sender: TObject);
  var
    i,j,k,t,index,pred,delp,temp,temp2:integer;
begin
if rbtncreatefolder.checked = true then
     begin
    if (length(edit3.Text)>0) and (edit3.Text<>'..') then begin
        if (VS>=3)   then  begin
        if sush(true,nk1,edit3.Text) then  begin

        i:=tabld[nk1].nach;
        while fat[i]<>1024 do i:=fat[i];
        fat[i]:=freep(i);
        tabld[fat[i]].name:=edit3.Text;
       tabld[fat[i]].format:='';
        tabld[fat[i]].tip:=true;
        fat[fat[i]]:=1024;
        k:=freep(fat[i]);
        tabld[fat[i]].nach:=k;
        tabld[k].name:='.';
        tabld[k].tip:=true;
        tabld[k].nach:=fat[i];
        t:=freep(k);
        fat[k]:=t;
        tabld[t].name:='..';
        tabld[t].tip:=true;
        tabld[t].nach:=nk1;
        fat[t]:=1024;
        tabld[fat[i]].razmer:=0;
        tabld[i].razmer:=tabld[i].razmer+1;
      reload;
        end
        end
        else
            showmessage('Not enough free memory!');
    end
    else
      showmessage('Incorrect data or absent!');
end
else if rbtncreatefile.Checked = true then
  begin
    if (length(edit3.Text)>0) and (length(edit4.Text)>0)then begin
        if strtoint(edit4.Text)<32*VS then begin
         if  sush(false,nk1,edit3.Text) then begin

        i:=tabld[nk1].nach;
        while fat[i]<>1024 do i:=fat[i];
        fat[i]:=freep(i);
        tabld[fat[i]].name:=edit3.Text;
        tabld[fat[i]].format:=copy(edit3.Text,length(edit3.Text)-4,3);
        tabld[fat[i]].tip:=false;
        tabld[fat[i]].razmer:=strtoint(edit4.Text);
        if radiobutton1.Checked then
             tabld[fat[i]].format:='txt'
        else
             tabld[fat[i]].format:='bin';
        tabld[fat[i]].nach:=freep(fat[i]);
        k:=tabld[fat[i]].nach;
        fat[fat[i]]:=1024;
        for j:=1 to (tabld[fat[i]].razmer-9) div 32 do begin
            fat[k]:=freep(k);
            k:=fat[k];
        end;
        fat[k]:=1024;
        reload;
        end
        end
        else
            showmessage('Not enough free memory!');
    end
    else
        showmessage('You did not enter name and \ or File Size!');
end
 else if rbtndelete.checked = true then
  begin
if listbox1.ItemIndex>=0 then begin
    if listbox1.Items.Strings[listbox1.ItemIndex]<>'dir>..' then begin
    pred:=tabld[nk1].nach;
    index:=tabld[nk1].nach;
    for i:=0 to  listbox1.ItemIndex do begin
       index:=fat[index];
       if i>0 then
          pred:=fat[pred];
    end;
    delP:=index;
    fat[pred]:=fat[index];
    if tabld[index].tip then begin
    showmessage('directory "'+tabld[index].name+'" and all its subdirectories have been deleted!');
        rekur(tabld[delp].nach);
        fat[delp]:=0;
        fat[tabld[delp].nach]:=0;
    end
    else begin
    showmessage('file "'+tabld[index].name+'.'+tabld[index].format+'" was removed!');
        i:=tabld[index].nach;
        while fat[i]<>1024 do begin
         j:=i;
         i:=fat[i];
         fat[j]:=0;
        end;
        fat[i]:=0;
        fat[index]:=0;
        end;
        reload;
    end
    else
      showmessage('You can not delete this directory!');
end
else
    showmessage('You did not select the folder to delete!');
end

else if rbtncopy.checked = true then
   begin
if listbox1.ItemIndex>=0 then begin
    if listbox1.Items.Strings[listbox1.ItemIndex]<>'dir>..' then begin
        index:=tabld[nk1].nach;
        for i:=0 to  listbox1.ItemIndex do
          index:=fat[index];
        if tabld[index].tip then begin
          showmessage('directory "'+tabld[index].name+'" and all its subdirectories are copied to the directory "'+edit2.text+'" !');
          temp:=nk1;
          nk1:=nk2;
          edit3.Text:=tabld[index].name;
          btnsubmit.Click;
          temp2:=tabld[nk2].nach;
                while   (fat[temp2]<>1024) and (tabld[temp2].name<>tabld[nk1].name) do temp2:=fat[temp2];
          rekurC(fat[tabld[index].nach],temp2);
          nk1:=temp;
        end
        else begin
          showmessage('file "'+tabld[index].name+'.'+tabld[index].format+'" was copied to directory "'+edit2.Text+'"!');
          temp:=nk1;
          nk1:=nk2;
          edit3.Text:=tabld[index].name;
          edit4.Text:=inttostr(tabld[index].razmer);
          btnsubmit.Click;
          nk1:=temp;
        end
    end
    else
      showmessage('This directory may not be copied!');
end
else
    showmessage('You have not picked anything up to copy!');
            reload;

end

else
 showmessage('select an operator please');
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:12:13+00:00Added an answer on May 27, 2026 at 9:12 pm

    Right at the end of this rather gruesome event handler is this code:

    showmessage('file "'+tabld[index].name+'.'+tabld[index].format+
      '" was copied to directory "'+edit2.Text+'"!');
    ...//do stuff
    btnsubmit.Click;
    

    What happens then is that as soon as you click OK on the message box, the event handler is re-entered because you called btnsubmit.Click and so the whole routine starts again. And the message box is shown, and you press OK and then btnsubmit.Click is called again and so on. If you have enough patience you should be able to get a stack overflow error!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi I have a grouped radio buttons (they look like normal jquery buttons when
I'm having a problem with accessing my buttons separately using jquery. Suppose I have
I have Grouped Table View in which I want to display Contact details. But
I tried thinking of an algorithm, but couldn't do it. Here is the problem:
I want to LIMIT Grouped results to 30, but instead I'm grouping all rows
I grouped my report by ID, but in preview mode's group drill down menu,
I am creating grouped table in my application. It works fine. But when I
I have created a grouped table view & I had a edit button in
I have build a grouped tableview with 2 sections. There always have to be
I have a grouped tableView with 5 sections and i want to add buttons

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.