Написание программы с использованием команд void prepod_see(int n), void admin_see(), void students_see(), void not_see2(bool t), страница 4

    {s=Form3->Memo1->Lines->Strings[i].c_str();

     j=1;p_n="";

     if(s[j]=='['){while(s[j+1]!=']')

                        {p_n=p_n+s[j+1];

                         j++;}

                  if(atoi(p_n.c_str())==n) return (i);

                  }

    }

}

int nomer_stroki_next(int n)

{AnsiString s='\0';

n=n+1;

s=Form3->Memo1->Lines->Strings[n].c_str();

for(int i=n+1;s[1]!='@';i++)

    {s=Form3->Memo1->Lines->Strings[i].c_str();

     if(s[1]=='['||s[1]=='@')return(i);

    }

}

void add_new_var(AnsiString s,int n)

{AnsiString p,p1;

 p=Form3->Memo1->Lines->Strings[n];

 Form3->Memo1->Lines->Strings[n]=s;

 if(p[1]!='@')

    {for(int i=n;s[1]!='@';i++)

        {s=Form3->Memo1->Lines->Strings[i+1];

         Form3->Memo1->Lines->Strings[i+1]=p;

         p=s;

         if(s[1]=='@'){Form3->Memo1->Lines->Add(s);return;}

        }

    }

else {p='@' ;

      p1=Form3->Edit11->Text;

      p=p+p1+'#';

      Form3->Memo1->Lines->Add(p);

      }

}

AnsiString add_text_vopros()

{AnsiString s="";

 for(int i=0;Form3->Memo3->Lines->Strings[i].IsEmpty()!=1;i++)s=s+Form3->Memo3->Lines->Strings[i].c_str();

 return s;

}

void Add_vopros(int f)

{int n1,i,end,n_s;

 AnsiString begin_v="",begin_a="",s,v="",n,s1;

 n1=atoi(Form3->Edit23->Text.c_str());

 n=Form3->Edit23->Text;

 if(f==1)end=end_BD();

 else {end=nomer_stroki(n1);n_s=end;}

//----вопрос----------------

    s=add_text_vopros();

    s=s+'#'; v=v+'['; v=v+n; v=v+']';

    s=v+s;

    Form3->Memo1->Lines->Strings[end]=s;

//--------1---------------

v="";s=Form3->Edit1->Text;

     s=s+'#';

     if(Form3->RadioButton1->Checked==true)v=v+'{';else v=v+'(';

     v=v+'1'; v=v+')';

     s=v+s;

     if(f==1)Form3->Memo1->Lines->Add(s);

     else Form3->Memo1->Lines->Strings[end+1]=s;

//---------2-----------------

v="";s=Form3->Edit2->Text;

     s=s+'#';

     if(Form3->RadioButton2->Checked==true)v=v+'{';else v=v+'(';

     v=v+'2'; v=v+')';

     s=v+s;

     if(f==1)Form3->Memo1->Lines->Add(s);

     else Form3->Memo1->Lines->Strings[end+2]=s;

//---------3----------------

v="";if(Form3->Edit3->Text!=""&&Form3->Edit3->Visible==true&&Form3->RadioButton3->Visible==true)

        {//s1=Form3->Memo1->Lines->Strings[end+3];

         s=Form3->Edit3->Text;

         s=s+'#';

         if(Form3->RadioButton3->Checked==true)v=v+'{';else v=v+'(';

         v=v+'3'; v=v+')';

         s=v+s;

         if(f==1)Form3->Memo1->Lines->Add(s);

         else{s1=Form3->Memo1->Lines->Strings[end+3];

               if(s1[1]=='['||s1[1]=='@'){add_new_var(s,end+3);}

               else if(s1[1]=='('||s1[1]=='{')Form3->Memo1->Lines->Strings[end+3]=s;

              }

        }

     else {if(f!=1&&nomer_stroki_next(n_s)>end+3)

             {s1=Form3->Memo1->Lines->Strings[end+3];

              if(s1[1]=='('||s1[1]=='{'){Form3->Memo1->Lines->Delete(end+3);end--;}

             }

          }

//------------4-------------

v="";if(Form3->Edit4->Text!=""&&Form3->Edit4->Visible==true&&Form3->RadioButton4->Visible==true)

        {s=Form3->Edit4->Text;

         s=s+'#';

         if(Form3->RadioButton4->Checked==true)v=v+'{';else v=v+'(';

         v=v+'4'; v=v+')';

         s=v+s;

         if(f==1)Form3->Memo1->Lines->Add(s);

         else{s1=Form3->Memo1->Lines->Strings[end+4];

              if(s1[1]=='['||s1[1]=='@'){add_new_var(s,end+4);}

              else if(s1[1]=='('||s1[1]=='{')Form3->Memo1->Lines->Strings[end+4]=s;

             }

        }

     else {if(f!=1&&nomer_stroki_next(n_s)>end+4)

              {s1=Form3->Memo1->Lines->Strings[end+4];

               if(s1[1]=='('||s1[1]=='{'){Form3->Memo1->Lines->Delete(end+4);end--;}

              }

          }

//-----------5--------------

v="";if(Form3->Edit5->Text!=""&&Form3->Edit5->Visible==true&&Form3->RadioButton5->Visible==true)

        {s=Form3->Edit5->Text;

         s=s+'#';

         if(Form3->RadioButton5->Checked==true)v=v+'{';else v=v+'(';

         v=v+'5'; v=v+')';

         s=v+s;

         if(f==1)Form3->Memo1->Lines->Add(s);

         else{s1=Form3->Memo1->Lines->Strings[end+5];

              if(s1[1]=='['||s1[1]=='@'){add_new_var(s,end+5);}

              else if(s1[1]=='('||s1[1]=='{')Form3->Memo1->Lines->Strings[end+5]=s;

             }

        }

     else {if(f!=1&&nomer_stroki_next(n_s)>end+5)

             {s1=Form3->Memo1->Lines->Strings[end+5];

              if(s1[1]=='('||s1[1]=='{'){Form3->Memo1->Lines->Delete(end+5);end--;}

             }

          }

//-------------6----------------

v="";if(Form3->Edit6->Text!=""&&Form3->Edit6->Visible==true&&Form3->RadioButton6->Visible==true)

        {s=Form3->Edit6->Text;

         s=s+'#';

         if(Form3->RadioButton6->Checked==true)v=v+'{';else v=v+'(';

         v=v+'6'; v=v+')';

         s=v+s;

         if(f==1)Form3->Memo1->Lines->Add(s);

         else{s1=Form3->Memo1->Lines->Strings[end+6];

              if(s1[1]=='['||s1[1]=='@'){add_new_var(s,end+6);}

              else if(s1[1]=='('||s1[1]=='{')Form3->Memo1->Lines->Strings[end+6]=s;