Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Sempronio, The Reader - Unit1.pas

Unit1.pas

Caricato da: Anonymous
Scarica il programma completo

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, MPlayer, StdCtrls, Menus, Grids, ExtCtrls;
  8.  
  9. type
  10.   Tfrmmainform = class(TForm)
  11.     a: TMediaPlayer;
  12.     button2: TButton;
  13.     MainMenu1: TMainMenu;
  14.     File1: TMenuItem;
  15.     Esci1: TMenuItem;
  16.     N1: TMenuItem;
  17.     About1: TMenuItem;
  18.     Visualizzamodificheeffettuate1: TMenuItem;
  19.     Button5: TButton;
  20.     memo2: TMemo;
  21.     CheckBox1: TCheckBox;
  22.     GroupBox2: TGroupBox;
  23.     RadioButton5: TRadioButton;
  24.     RadioButton6: TRadioButton;
  25.     GroupBox3: TGroupBox;
  26.     RadioButton1: TRadioButton;
  27.     RadioButton2: TRadioButton;
  28.     Button1: TButton;
  29.     StringGrid1: TStringGrid;
  30.     Memo1: TMemo;
  31.     Image2: TImage;
  32.     Image1: TImage;
  33.     Button3: TButton;
  34.     ListBox1: TListBox;
  35.     Button4: TButton;
  36.     Button6: TButton;
  37.     procedure button2Click(Sender: TObject);
  38.     procedure RadioButton2Click(Sender: TObject);
  39.     procedure memo2Change(Sender: TObject);
  40.     procedure RadioButton1Click(Sender: TObject);
  41.     procedure memo2KeyPress(Sender: TObject; var Key: Char);
  42.     procedure About1Click(Sender: TObject);
  43.     procedure Esci1Click(Sender: TObject);
  44.     procedure Visualizzamodificheeffettuate1Click(Sender: TObject);
  45.     procedure Button5Click(Sender: TObject);
  46.     procedure RadioButton5Click(Sender: TObject);
  47.     procedure RadioButton6Click(Sender: TObject);
  48.     procedure FormCreate(Sender: TObject);
  49.     procedure Button1Click(Sender: TObject);
  50.     procedure Button3Click(Sender: TObject);
  51.     procedure Button4Click(Sender: TObject);
  52.     procedure Button6Click(Sender: TObject);
  53.   private
  54.     { Private declarations }
  55.   public
  56.     { Public declarations }
  57.   end;
  58.  
  59. var
  60.   frmmainform: Tfrmmainform;
  61.   temporaneo,voce:string;
  62.   pos:integer;
  63. implementation
  64.  
  65. uses Unit2, Unit3, Unit4, Unit5;
  66.  
  67. {$R *.dfm}
  68.  
  69. procedure Tfrmmainform.button2Click(Sender: TObject);
  70. begin
  71.  frmfonetica.groupbox1.Visible:=true;
  72.  frmfonetica.listbox2.Visible:=false;
  73.  frmfonetica.combobox1.Visible:=true;
  74.  frmfonetica.listbox1.visible:=true;
  75.  frmfonetica.button2.Visible:=false;
  76.  frmfonetica.button3.visible:=true;
  77.  frmfonetica.button2.enabled:=false;
  78.  frmfonetica.button3.enabled:=false;
  79.  frmfonetica.combobox1.Text:='';
  80.  frmfonetica.combobox1.itemindex:=-1;
  81.  frmfonetica.listbox1.clear;
  82.  frmfonetica.listbox1.itemindex:=-1;
  83.  frmfonetica.stringgrid1.visible:=true;
  84.  frmfonetica.stringgrid2.Visible:=false;
  85.  frmfonetica.button4.Visible:=false;
  86.  frmfonetica.radiobutton13.Checked:=false;
  87.  frmfonetica.radiobutton2.Checked:=false;
  88.  frmfonetica.radiobutton3.Checked:=false;
  89.  frmfonetica.radiobutton7.Checked:=false;
  90.  frmfonetica.radiobutton11.Checked:=false;
  91.  frmfonetica.radiobutton5.Checked:=false;
  92.  frmfonetica.groupbox6.Visible:=false;
  93.  frmfonetica.radiobutton17.Checked:=true;
  94.  frmfonetica.showmodal;
  95. end;
  96.  
  97. procedure Tfrmmainform.RadioButton2Click(Sender: TObject);
  98. var i:integer;
  99. begin
  100.  button2.Visible:=true;
  101.  for i:=0 to length(memo2.Text)-1 do
  102.   begin
  103.    frmfonetica.stringgrid1.rowCount:=i+1;
  104.    frmfonetica.StringGrid1.cells[0,i]:=inttostr(i+1);
  105.    frmfonetica.StringGrid1.cells[1,i]:=memo2.text[i+1];
  106.    button2.Enabled:=true;
  107.   end
  108. end;
  109.  
  110. procedure Tfrmmainform.memo2Change(Sender: TObject);
  111. var i:integer;
  112. begin
  113. listbox1.clear;
  114.  if memo1.text='' then
  115.   button2.Enabled:=false
  116.  else
  117.   button2.Enabled:=true;
  118.  
  119.  if radiobutton2.Checked then
  120.   for i:=0 to length(memo2.Text)-1 do
  121.    begin
  122.     frmfonetica.stringgrid1.rowCount:=i+1;
  123.     frmfonetica.StringGrid1.cells[0,i]:=inttostr(i+1);
  124.     frmfonetica.StringGrid1.cells[1,i]:=memo2.text[i+1];
  125.    end;
  126. frmfonetica.Label11.Caption:='Il testo è composto da '+inttostr((length(trim(memo2.text)))) +' caratteri';
  127. end;
  128.  
  129. procedure Tfrmmainform.RadioButton1Click(Sender: TObject);
  130. begin
  131.  button2.Enabled:=false;
  132.  button2.Visible:=false;
  133. end;
  134.  
  135. procedure Tfrmmainform.memo2KeyPress(Sender: TObject; var Key: Char);
  136. begin
  137. if ord(key) in [13] then
  138. begin
  139. button1.click;
  140. key:=chr(0);
  141. end;
  142. if ord(key) in [8,32,97..122] then
  143. exit
  144. else
  145.  
  146. end;
  147.  
  148. procedure Tfrmmainform.About1Click(Sender: TObject);
  149. begin
  150.  frmabout.show;
  151. end;
  152.  
  153. procedure Tfrmmainform.Esci1Click(Sender: TObject);
  154. begin
  155.  halt
  156. end;
  157.  
  158. procedure Tfrmmainform.Visualizzamodificheeffettuate1Click(
  159.   Sender: TObject);
  160. begin
  161.  frmmodifiche.show;
  162. end;
  163.  
  164. procedure Tfrmmainform.Button5Click(Sender: TObject);
  165. var messaggio:array of char;
  166.     n,n1,n2:integer;
  167. begin
  168.  if memo1.Text='' then
  169.   showmessage('Non posso leggere ciò che non c''è!!!, prima inserisci una stringa e poi riclicca qua');
  170.  memo1.Text:=lowercase(memo1.Text);
  171.  memo1.Refresh;
  172.  setlength(messaggio,length(memo1.Text));
  173.  
  174.  frmmodifiche.resetta.click;
  175.  for n:=0 to Length(memo1.Text)-1 do
  176.   begin
  177.    if memo1.text[n+1] in ['0','1','2','3','4','5','6','7','8','9'] then  //se il primo è un numero allora ...
  178.     begin
  179.      if (memo1.text[n+2] in ['0','1','2','3','4','5','6','7','8','9']) then // se anche il secondo è un numero allora ...
  180.       begin
  181.        if (memo1.text[n+3] in ['0','1','2','3','4','5','6','7','8','9']) then // se anche il terzo  è un numero allora
  182.         begin
  183.          if (memo1.text[n+4] in ['0','1','2','3','4','5','6','7','8','9']) then  // se anche il quarto  è un numero allora
  184.           begin
  185.            if (memo1.Text[n+5] in ['0','1','2','3','4','5','6','7','8','9']) then // se anche il quinto è un numero allora
  186.             begin
  187.              if (memo1.Text[n+6] in ['0','1','2','3','4','5','6','7','8','9']) then //se anche il sesto è un numero allora
  188.               begin
  189.                if (memo1.Text[n+7] in ['0','1','2','3','4','5','6','7','8','9']) then  //se anche il settimo è un numero allora
  190.                 begin
  191.                  if (memo1.Text[n+8] in ['0','1','2','3','4','5','6','7','8','9']) then  //se anche l'ottavo è un numero allora
  192.                   begin
  193.                    if not (memo1.text[n+1]='0')then //se il primo non è lo 0 allora
  194.                     begin
  195.                      if memo1.text[n+1]='1' then   //se il primo è l' 1 allora
  196.                       begin
  197.                        a.DeviceType:=dtautoselect;
  198.                        a.FileName:='suoni\'+voce+'\'+'1'+memo1.text[n+2]+'.wav';
  199.                        a.open;
  200.                        a.Wait:=true;
  201.                        a.Play;
  202.                        a.DeviceType:=dtautoselect;
  203.                        a.FileName:='suoni\'+voce+'\'+'1000000i'+'.wav';
  204.                        a.open;
  205.                        a.Wait:=true;
  206.                        a.Play;
  207.                       end
  208.                      else //altrimenti se il primo  non è l' 1
  209.                       begin
  210.                        if memo1.text[n+2]='0' then  // se il secondo è 0  allora
  211.                         begin
  212.                          a.DeviceType:=dtautoselect;
  213.                          a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'0'+'.wav';
  214.                          a.open;
  215.                          a.Wait:=true;
  216.                          a.Play;
  217.                         end
  218.                        else  //altrimenti se il secondo non è 0
  219.                         begin
  220.                          a.DeviceType:=dtautoselect;
  221.                          a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'0.wav';
  222.                          a.open;
  223.                          a.Wait:=true;
  224.                          a.Play;
  225.                          a.DeviceType:=dtautoselect;
  226.                          a.FileName:='suoni\'+voce+'\'+memo1.text[n+2]+'.wav';
  227.                          a.open;
  228.                          a.Wait:=true;
  229.                          a.Play;
  230.                         end;
  231.                        a.DeviceType:=dtautoselect;
  232.                        a.FileName:='suoni\'+voce+'\'+'1000000i'+'.wav';
  233.                        a.open;
  234.                        a.Wait:=true;
  235.                        a.Play;
  236.                       end;
  237.                     end
  238.                    else
  239.                     begin
  240.                     end;
  241.                   end
  242.                  else    //se il settimo non è un numero
  243.                   begin
  244.                    if not (memo1.text[n+1]='0') then  // se il primo non è 0
  245.                     begin
  246.                      if memo1.text[n+1]= '1' then   //se il primo è 1
  247.                       begin
  248.                        a.DeviceType:=dtautoselect;
  249.                        a.FileName:='suoni\'+voce+'\'+'un'+'.wav';
  250.                        a.open;
  251.                        a.Wait:=true;
  252.                        a.Play;
  253.                        a.DeviceType:=dtautoselect;
  254.                        a.FileName:='suoni\'+voce+'\'+'1000000'+'.wav';
  255.                        a.open;
  256.                        a.Wait:=true;
  257.                        a.Play;
  258.                       end
  259.                      else  //se il primo è maggiore di 1
  260.                       begin
  261.                        if memo1.Text[n]in ['1','2','3','4','5','6','7','8','9'] then
  262.                         begin
  263.                         end
  264.                        else
  265.                         begin
  266.                          a.DeviceType:=dtautoselect;
  267.                          a.FileName:='suoni\'+voce+'\'+memo1.Text[n+1]+'.wav';
  268.                          a.open;
  269.                          a.Wait:=true;
  270.                          a.Play;
  271.                          a.DeviceType:=dtautoselect;
  272.                          a.FileName:='suoni\'+voce+'\'+'1000000i'+'.wav';
  273.                          a.open;
  274.                          a.Wait:=true;
  275.                          a.Play;
  276.                         end;
  277.                       end;
  278.                     end
  279.                    else
  280.                     begin
  281.                     end;
  282.                   end;
  283.                  end
  284.               else
  285.                begin
  286.                if  not(memo1.Text[n+1]='0') then
  287.                 begin
  288.                  if memo1.Text[n+1]<>'1' then
  289.                   begin
  290.                    a.DeviceType:=dtautoselect;
  291.                    a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  292.                    a.open;
  293.                    a.Wait:=true;
  294.                    a.Play;
  295.                   end;
  296.                    a.DeviceType:=dtautoselect;
  297.                    a.FileName:='suoni\'+voce+'\'+'100'+'.wav';
  298.                    a.open;
  299.                    a.Wait:=true;
  300.                    a.Play;
  301.                 end;
  302.                end;
  303.               end
  304.              else   //se il sesto non è un numero
  305.               begin
  306.               if not(memo1.Text[n+1]='0') then //se il primo non è 0
  307.                begin
  308.                 if memo1.Text[n+1]='1' then //se il primo è 1
  309.                  begin
  310.                   a.DeviceType:=dtautoselect;
  311.                   a.FileName:='suoni\'+voce+'\'+'1'+memo1.text[n+2]+'.wav';
  312.                   a.open;
  313.                   a.Wait:=true;
  314.                   a.Play;
  315.                  end
  316.                 else  //se il primo è maggiore di 1
  317.                  begin
  318.                   a.DeviceType:=dtautoselect;
  319.                   a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'0'+'.wav';
  320.                   a.open;
  321.                   a.Wait:=true;
  322.                   a.Play;
  323.                  end;
  324.                end;
  325.              end;
  326.            end
  327.           else // se il quinto non è un numero
  328.            begin
  329.             if  (memo1.text[n+1]='0') then //se il primo  è 0
  330.              begin
  331.               if (memo1.Text[n]in['0'])and(memo1.Text[n-1]in['0']) then
  332.                begin
  333.                end
  334.               else
  335.                begin
  336.                 a.DeviceType:=dtautoselect;
  337.                 a.FileName:='suoni\'+voce+'\'+'1000a'+'.wav';
  338.                 a.open;
  339.                 a.Wait:=true;
  340.                 a.Play;
  341.                end
  342.               end
  343.                else   //se il primo non è 0
  344.                 if memo1.Text[n]='1' then   //se il precedente era 1
  345.                 begin
  346.                   a.DeviceType:=dtautoselect;
  347.                   a.FileName:='suoni\'+voce+'\'+'1000a'+'.wav';
  348.                   a.open;
  349.                   a.Wait:=true;
  350.                   a.Play;
  351.                 end
  352.                 else          //se il precedente non era 1
  353.                  begin
  354.                   if memo1.text[n+1]='1' then    // se  il primo è 1
  355.                    begin
  356.                     if not(memo1.Text[n]=chr(0))then
  357.                      begin
  358.                       a.DeviceType:=dtautoselect;
  359.                       a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  360.                       a.open;
  361.                       a.Wait:=true;
  362.                       a.Play;
  363.                       a.DeviceType:=dtautoselect;
  364.                       a.FileName:='suoni\'+voce+'\'+'1000a'+'.wav';
  365.                       a.open;
  366.                       a.Wait:=true;
  367.                       a.Play;
  368.                      end
  369.                     else
  370.                      begin
  371.                       a.DeviceType:=dtautoselect;
  372.                       a.FileName:='suoni\'+voce+'\'+'1000'+'.wav';
  373.                       a.open;
  374.                       a.Wait:=true;
  375.                       a.Play;
  376.                      end
  377.                    end
  378.                   else  // se il primo è superiore a 1
  379.                    begin
  380.                     a.DeviceType:=dtautoselect;
  381.                     a.FileName:='suoni\'+voce+'\'+(memo1.text[n+1])+'.wav';
  382.                     a.open;
  383.                     a.Wait:=true;
  384.                     a.Play;
  385.                     a.DeviceType:=dtautoselect;
  386.                     a.FileName:='suoni\'+voce+'\'+'1000a'+'.wav';
  387.                     a.open;
  388.                     a.Wait:=true;
  389.                     a.Play;
  390.                    end
  391.                  end;
  392.                end;
  393.              end
  394.             else  // se il quarto non è un numero
  395.              begin
  396.               If not(memo1.text[n+1]='0') then  // se il primo non è 0
  397.                begin
  398.                 if memo1.Text[n+1]<>'1' then   //se il primo non è 1
  399.                  begin
  400.                   a.DeviceType:=dtautoselect;
  401.                   a.FileName:='suoni\'+voce+'\'+memo1.Text[n+1]+'.wav';
  402.                   a.open;
  403.                   a.Wait:=true;
  404.                   a.Play;
  405.                  end;
  406.                 a.DeviceType:=dtautoselect;   // sia se il primo è 1 sia se non lo è
  407.                 a.FileName:='suoni\'+voce+'\'+'100'+'.wav';
  408.                 a.open;
  409.                 a.Wait:=true;
  410.                 a.Play;
  411.                end;
  412.              end;
  413.           end
  414.        else // se il terzo non è un  numero
  415.         begin
  416.          if not(memo1.text[n+1]='0') then  //se il primo non è 0
  417.           begin
  418.            if memo1.text[n+1]='1' then //se il primo è 1
  419.             begin
  420.              a.DeviceType:=dtautoselect;
  421.              a.FileName:='suoni\'+voce+'\'+'1'+memo1.text[n+2]+'.wav';
  422.              a.open;
  423.              a.Wait:=true;
  424.              a.Play;
  425.             end
  426.            else         //se il primo è maggiore di 1
  427.             begin
  428.              a.DeviceType:=dtautoselect;
  429.              a.FileName:='suoni\'+voce+'\'+memo1.Text[n+1]+'0'+'.wav';
  430.              a.open;
  431.              a.Wait:=true;
  432.              a.Play;
  433.             end
  434.           end
  435.         end;
  436.       end
  437.      else   //se il secondo non è un numero
  438.       begin
  439.        if not (memo1.Text[n+1]='0') then   //se il primo non è 0
  440.         begin
  441.          if memo1.text[n+1]='1' then  //se il primo è 1
  442.           begin
  443.            if memo1.Text[n]='1' then //se il precedente era 1
  444.             begin  //non fare niente
  445.             end
  446.            else    //se il precedente non era 1
  447.             begin
  448.              a.DeviceType:=dtautoselect;
  449.              a.FileName:='suoni\'+voce+'\'+memo1.Text[n+1]+'.wav';
  450.              a.open;
  451.              a.Wait:=true;
  452.              a.Play;
  453.             end;
  454.           end
  455.          else        //se il primo non è 1
  456.           begin
  457.              a.DeviceType:=dtautoselect;
  458.              a.FileName:='suoni\'+voce+'\'+memo1.Text[n+1]+'.wav';
  459.              a.open;
  460.              a.Wait:=true;
  461.              a.Play;
  462.           end;
  463.         end
  464.  //          else
  465.  
  466.       end;
  467.    end
  468.    else
  469. //    ---------------------------------------------------------------------------------------------------------
  470.     begin
  471.      if radiobutton2.checked=true then
  472.       begin
  473.        messaggio[n]:=memo1.text[n+1];
  474.        if messaggio[n]='a' then
  475.         begin
  476.          if frmmodifiche.A.count=0 then
  477.            checkbox1.checked:=true
  478.          else
  479.           begin
  480.            frmmodifiche.A.ItemIndex:=frmmodifiche.A.ItemIndex+1;
  481.            temporaneo:=frmmodifiche.A.Items[frmmodifiche.A.itemindex];
  482.           end;
  483.         end
  484.        else
  485.         begin
  486.          if messaggio[n]='b' then
  487.           begin
  488.            if frmmodifiche.b.count=0 then
  489.              checkbox1.checked:=true
  490.            else
  491.             begin
  492.              frmmodifiche.b.ItemIndex:=frmmodifiche.b.ItemIndex+1;
  493.              temporaneo:=frmmodifiche.b.Items[frmmodifiche.b.itemindex];
  494.             end;
  495.           end
  496.          else
  497.           if messaggio[n]='c' then
  498.            begin
  499.             if frmmodifiche.c.count=0 then
  500.              checkbox1.checked:=true
  501.             else
  502.              begin
  503.               frmmodifiche.c.ItemIndex:=frmmodifiche.c.ItemIndex+1;
  504.               temporaneo:=frmmodifiche.c.Items[frmmodifiche.c.itemindex];
  505.              end;
  506.            end
  507.           else
  508.            begin
  509.             if messaggio[n]='d' then
  510.              begin
  511.               if frmmodifiche.d.count=0 then
  512.                 checkbox1.checked:=true
  513.               else
  514.                begin
  515.                 frmmodifiche.d.ItemIndex:=frmmodifiche.d.ItemIndex+1;
  516.                 temporaneo:=frmmodifiche.d.Items[frmmodifiche.d.itemindex];
  517.                end;
  518.              end
  519.             else
  520.              begin
  521.               if messaggio[n]='e' then
  522.                begin
  523.                 if frmmodifiche.e.count=0 then
  524.                   checkbox1.checked:=true
  525.                 else
  526.                  begin
  527.                   frmmodifiche.e.ItemIndex:=frmmodifiche.e.ItemIndex+1;
  528.                   temporaneo:=frmmodifiche.e.Items[frmmodifiche.e.itemindex];
  529.                  end;
  530.                end
  531.               else
  532.                begin
  533.                 if messaggio[n]='f' then
  534.                  begin
  535.                   if frmmodifiche.f.count=0 then
  536.                     checkbox1.checked:=true
  537.                   else
  538.                    begin
  539.                     frmmodifiche.f.ItemIndex:=frmmodifiche.f.ItemIndex+1;
  540.                     temporaneo:=frmmodifiche.f.Items[frmmodifiche.f.itemindex];
  541.                    end;
  542.                  end
  543.                 else
  544.                  begin
  545.                  if messaggio[n]='g' then
  546.                   begin
  547.                    if frmmodifiche.g.count=0 then
  548.                      checkbox1.checked:=true
  549.                    else
  550.                     begin
  551.                      frmmodifiche.g.ItemIndex:=frmmodifiche.g.ItemIndex+1;
  552.                      temporaneo:=frmmodifiche.g.Items[frmmodifiche.g.itemindex];
  553.                     end;
  554.                  end
  555.                 else
  556.                  begin
  557.                   if messaggio[n]='h' then
  558.                    begin
  559.                     if frmmodifiche.h.count=0 then
  560.                       checkbox1.checked:=true
  561.                     else
  562.                      begin
  563.                       frmmodifiche.h.ItemIndex:=frmmodifiche.h.ItemIndex+1;
  564.                       temporaneo:=frmmodifiche.h.Items[frmmodifiche.h.itemindex];
  565.                      end;
  566.                    end
  567.                   else
  568.                    begin
  569.                    if messaggio[n]='i' then
  570.                     begin
  571.                      if frmmodifiche.i.count=0 then
  572.                        checkbox1.checked:=true
  573.                      else
  574.                       begin
  575.                        frmmodifiche.i.ItemIndex:=frmmodifiche.i.ItemIndex+1;
  576.                        temporaneo:=frmmodifiche.i.Items[frmmodifiche.i.itemindex];
  577.                       end;
  578.                     end
  579.                    else
  580.                     begin
  581.                      if messaggio[n]='j' then
  582.                       begin
  583.                        if frmmodifiche.j.count=0 then
  584.                          checkbox1.checked:=true
  585.                        else
  586.                         begin
  587.                          frmmodifiche.j.ItemIndex:=frmmodifiche.j.ItemIndex+1;
  588.                          temporaneo:=frmmodifiche.j.Items[frmmodifiche.j.itemindex];
  589.                         end;
  590.                        end
  591.                      else
  592.                       begin
  593.                        if messaggio[n]='k' then
  594.                         begin
  595.                          if frmmodifiche.k.count=0 then
  596.                            checkbox1.checked:=true
  597.                          else
  598.                           begin
  599.                            frmmodifiche.k.ItemIndex:=frmmodifiche.k.ItemIndex+1;
  600.                            temporaneo:=frmmodifiche.k.Items[frmmodifiche.k.itemindex];
  601.                           end;
  602.                         end
  603.                        else
  604.                         begin
  605.                          if messaggio[n]='l' then
  606.                           begin
  607.                            if frmmodifiche.l.count=0 then
  608.                              checkbox1.checked:=true
  609.                           else
  610.                          begin
  611.                           frmmodifiche.l.ItemIndex:=frmmodifiche.l.ItemIndex+1;
  612.                           temporaneo:=frmmodifiche.l.Items[frmmodifiche.l.itemindex];
  613.                          end;
  614.                         end
  615.                        else
  616.                         begin
  617.                          if messaggio[n]='m' then
  618.                           begin
  619.                            if frmmodifiche.m.count=0 then
  620.                              checkbox1.checked:=true
  621.                            else
  622.                             begin
  623.                              frmmodifiche.m.ItemIndex:=frmmodifiche.m.ItemIndex+1;
  624.                              temporaneo:=frmmodifiche.m.Items[frmmodifiche.m.itemindex];
  625.                             end;
  626.                           end
  627.                          else
  628.                           begin
  629.                            if messaggio[n]='n' then
  630.                             begin
  631.                              if frmmodifiche.n.count=0 then
  632.                                checkbox1.checked:=true
  633.                              else
  634.                               begin
  635.                                frmmodifiche.n.ItemIndex:=frmmodifiche.n.ItemIndex+1;
  636.                                temporaneo:=frmmodifiche.n.Items[frmmodifiche.n.itemindex];
  637.                               end;
  638.                             end
  639.                            else
  640.                             begin
  641.                              if messaggio[n]='o' then
  642.                               begin
  643.                                if frmmodifiche.o.count=0 then
  644.                                  checkbox1.checked:=true
  645.                                else
  646.                                 begin
  647.                                  frmmodifiche.o.ItemIndex:=frmmodifiche.o.ItemIndex+1;
  648.                                  temporaneo:=frmmodifiche.o.Items[frmmodifiche.o.itemindex];
  649.                                 end;
  650.                               end
  651.                              else
  652.                               begin
  653.                                if messaggio[n]='p' then
  654.                                 begin
  655.                                  if frmmodifiche.p.count=0 then
  656.                                    checkbox1.checked:=true
  657.                                  else
  658.                                   begin
  659.                                    frmmodifiche.p.ItemIndex:=frmmodifiche.p.ItemIndex+1;
  660.                                    temporaneo:=frmmodifiche.p.Items[frmmodifiche.p.itemindex];
  661.                                   end;
  662.                                 end
  663.                                else
  664.                                 begin
  665.                                  if messaggio[n]='q' then
  666.                                   begin
  667.                                    if frmmodifiche.q.count=0 then
  668.                                      checkbox1.checked:=true
  669.                                    else
  670.                                     begin
  671.                                      frmmodifiche.q.ItemIndex:=frmmodifiche.q.ItemIndex+1;
  672.                                      temporaneo:=frmmodifiche.q.Items[frmmodifiche.q.itemindex];
  673.                                     end;
  674.                                   end
  675.                                  else
  676.                                   begin
  677.                                    if messaggio[n]='r' then
  678.                                     begin
  679.                                      if frmmodifiche.r.count=0 then
  680.                                       checkbox1.checked:=true
  681.                                      else
  682.                                       begin
  683.                                        frmmodifiche.r.ItemIndex:=frmmodifiche.r.ItemIndex+1;
  684.                                        temporaneo:=frmmodifiche.r.Items[frmmodifiche.r.itemindex];
  685.                                       end;
  686.                                     end
  687.                                    else
  688.                                     begin
  689.                                      if messaggio[n]='s' then
  690.                                       begin
  691.                                        if frmmodifiche.s.count=0 then
  692.                                          checkbox1.checked:=true
  693.                                        else
  694.                                         begin
  695.                                          frmmodifiche.s.ItemIndex:=frmmodifiche.s.ItemIndex+1;
  696.                                          temporaneo:=frmmodifiche.s.Items[frmmodifiche.s.itemindex];
  697.                                         end;
  698.                                       end
  699.                                      else
  700.                                       begin
  701.                                        if messaggio[n]='t' then
  702.                                         begin
  703.                                          if frmmodifiche.t.count=0 then
  704.                                            checkbox1.checked:=true
  705.                                          else
  706.                                           begin
  707.                                            frmmodifiche.t.ItemIndex:=frmmodifiche.t.ItemIndex+1;
  708.                                            temporaneo:=frmmodifiche.t.Items[frmmodifiche.t.itemindex];
  709.                                           end;
  710.                                         end
  711.                                        else
  712.                                         begin
  713.                                          if messaggio[n]='u' then
  714.                                           begin
  715.                                            if frmmodifiche.u.count=0 then
  716.                                              checkbox1.checked:=true
  717.                                            else
  718.                                             begin
  719.                                              frmmodifiche.u.ItemIndex:=frmmodifiche.u.ItemIndex+1;
  720.                                              temporaneo:=frmmodifiche.u.Items[frmmodifiche.u.itemindex];
  721.                                             end;
  722.                                           end
  723.                                          else
  724.                                           begin
  725.                                            if messaggio[n]='v' then
  726.                                             begin
  727.                                              if frmmodifiche.v.count=0 then
  728.                                                checkbox1.checked:=true
  729.                                              else
  730.                                               begin
  731.                                                frmmodifiche.v.ItemIndex:=frmmodifiche.v.ItemIndex+1;
  732.                                                temporaneo:=frmmodifiche.v.Items[frmmodifiche.v.itemindex];
  733.                                               end;
  734.                                             end
  735.                                            else
  736.                                             begin
  737.                                              if messaggio[n]='w' then
  738.                                               begin
  739.                                                if frmmodifiche.w.count=0 then
  740.                                                  checkbox1.checked:=true
  741.                                                else
  742.                                                 begin
  743.                                                  frmmodifiche.w.ItemIndex:=frmmodifiche.w.ItemIndex+1;
  744.                                                  temporaneo:=frmmodifiche.w.Items[frmmodifiche.w.itemindex];
  745.                                                 end;
  746.                                               end
  747.                                              else
  748.                                               begin
  749.                                                if messaggio[n]='x' then
  750.                                                 begin
  751.                                                  if frmmodifiche.x.count=0 then
  752.                                                    checkbox1.checked:=true
  753.                                                  else
  754.                                                   begin
  755.                                                    frmmodifiche.x.ItemIndex:=frmmodifiche.x.ItemIndex+1;
  756.                                                    temporaneo:=frmmodifiche.x.Items[frmmodifiche.x.itemindex];
  757.                                                   end;
  758.                                                 end
  759.                                                else
  760.                                                 begin
  761.                                                  if messaggio[n]='y' then
  762.                                                   begin
  763.                                                    if frmmodifiche.y.count=0 then
  764.                                                      checkbox1.checked:=true
  765.                                                    else
  766.                                                     begin
  767.                                                      frmmodifiche.y.ItemIndex:=frmmodifiche.y.ItemIndex+1;
  768.                                                      temporaneo:=frmmodifiche.y.Items[frmmodifiche.y.itemindex];
  769.                                                     end;
  770.                                                   end
  771.                                                  else
  772.                                                   begin
  773.                                                    if messaggio[n]='z' then
  774.                                                     begin
  775.                                                      if frmmodifiche.z.count=0 then
  776.                                                        checkbox1.checked:=true
  777.                                                      else
  778.                                                      begin
  779.                                                       frmmodifiche.z.ItemIndex:=frmmodifiche.z.ItemIndex+1;
  780.                                                       temporaneo:=frmmodifiche.z.Items[frmmodifiche.z.itemindex];
  781.                                                      end;
  782.                                                     end
  783.                                                   else
  784.                                                    begin
  785.                                                     if messaggio[n]=' ' then
  786.                                                      begin
  787.                                                       temporaneo:=('spazio-');
  788.                                                      end
  789.                                                     end;
  790.                                                   end;
  791.                                                 end;
  792.                                               end;
  793.                                             end;
  794.                                           end;
  795.                                         end;
  796.                                       end;
  797.                                     end;
  798.                                   end;
  799.                                 end;
  800.                               end;
  801.                             end;
  802.                           end;
  803.                         end;
  804.                       end;
  805.                     end;
  806.                   end;
  807.                 end;
  808.               end;
  809.             end;
  810.           end;
  811.         end;
  812.       end;
  813.     end;
  814.  
  815.     if checkbox1.checked=false then
  816.     begin
  817.      a.DeviceType:=dtautoselect;
  818.      a.FileName:='suoni\'+voce+'\'+temporaneo+messaggio[n]+'.wav';
  819.      a.open;
  820.      a.Wait:=true;
  821.      a.Play;
  822.    end;
  823.  end;
  824. // -----------------------------------------------------------------------------------
  825.  //else   //se l'opzione è su: "automatico" allora
  826. //------------------------------------------------------------------------------------
  827.  
  828.  
  829.    if (radiobutton1.checked=true) or (checkbox1.checked=true) then
  830.     begin
  831.       checkbox1.checked:=false;
  832.    if memo1.text[n+1] in ['a','h','j','o','w','x','y'] then
  833.     begin
  834.      a.DeviceType:=dtautoselect;
  835.      a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  836.      a.open;
  837.      a.Wait:=true;
  838.      a.Play;
  839.     end
  840.    else
  841.     begin
  842.      if memo1.text[n+1] in ['b','d','f','k','m','p','q','r','t','v','z'] then  //altrimenti, se la la lettera è una di quelle che possono essere pronunciate doppie
  843.       begin
  844.        if not (memo1.Text[n+2]=memo1.Text[n+1]) then   //se la successiva non è uguale a quella corrente allora
  845.         begin
  846.          if not (memo1.Text[n]=memo1.Text[n+1] ) then  //se la precedente non è uguale a quella corrente allora
  847.           begin
  848.            a.DeviceType:=dtautoselect;
  849.            a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  850.            a.open;
  851.            a.Wait:=true;
  852.            a.Play;
  853.           end
  854.          else   // altrimenti se la precedente è uguale
  855.           begin   //non fare nulla
  856.           end;
  857.         end
  858.        else     //altrimenti se la successiva è uguale allora
  859.         begin                     //pronuncia la lettera doppia
  860.          a.DeviceType:=dtautoselect;
  861.          a.FileName:='suoni\'+voce+'\'+'doppia-'+memo1.text[n+1]+'.wav';
  862.          a.open;
  863.          a.Wait:=true;
  864.          a.Play;
  865.         end;
  866.       end
  867.      else   //altrimenti, se la la lettera non è di quelle che possono essere pronunciate doppie
  868.       begin
  869.        if memo1.Text[n+1] in ['c'] then //se è una c                      ccccccccccccccccccccccccccccccccccccccccccccccccc
  870.         begin
  871.          if (memo1.Text[n]=memo1.Text[n+1]) then
  872.           begin
  873.           end
  874.          else
  875.           begin
  876.            if memo1.text[n+2]=memo1.Text[n+1] then  //se la seconda è uguale alla prima (se è doppia)
  877.             begin
  878.              if memo1.Text[n+3] in ['e','i'] then    //e se la la terza è una 'e' o una 'i'
  879.               begin
  880.                a.DeviceType:=dtautoselect;
  881.                a.FileName:='suoni\'+voce+'\'+'doppia-'+'dolce-'+memo1.text[n+1]+'.wav';
  882.                a.open;
  883.                a.Wait:=true;
  884.                a.Play;
  885.               end
  886.              else   //altrimenti se se la terza non è ne una 'e' nè una 'i'
  887.               begin
  888.                a.DeviceType:=dtautoselect;
  889.                a.FileName:='suoni\'+voce+'\'+'doppia-'+'dura-'+memo1.text[n+1]+'.wav';
  890.                a.open;
  891.                a.Wait:=true;
  892.                a.Play;
  893.               end;
  894.             end
  895.            else //altrimenti se non è doppia
  896.             begin
  897.              if memo1.text[n+2] in ['e','i'] then     //se la successiva è una 'e' o una 'i' allora
  898.              if memo1.Text[n]='s' then //se la precedente è una s allora
  899.              begin //non fare niente
  900.              end
  901.              else //altrimenti se la precedente non è una s
  902.               begin
  903.                a.DeviceType:=dtautoselect;
  904.                a.FileName:='suoni\'+voce+'\'+'dolce-'+memo1.text[n+1]+'.wav';
  905.                a.open;
  906.                a.Wait:=true;
  907.                a.Play;
  908.              end
  909.             else//altrimenti se la successiva non è nè una 'e' nè una 'i'
  910.              begin
  911.               a.DeviceType:=dtautoselect;
  912.               a.FileName:='suoni\'+voce+'\'+'dura-'+memo1.text[n+1]+'.wav';
  913.               a.open;
  914.               a.Wait:=true;
  915.               a.Play;
  916.              end;
  917.             end;
  918.           end;
  919.         end
  920.        else  //altrimenti se non è una 'c'
  921.         begin
  922.          if memo1.Text[n+1] in ['g'] then    //se è un 'g' allora         ggggggggggggggggggggggggggggggggggggggggggggggggg
  923.           begin
  924.            if memo1.text[n]=memo1.Text[n+1] then //se la precedente è una 'g' allora
  925.             begin   //non fare niente
  926.             end
  927.            else  //altrimenti se la precedente non è una 'g'
  928.             begin
  929.              if memo1.Text[n+2]=memo1.Text[n+1] then  //se la seconda è una 'g' (se è doppia) allora
  930.               begin
  931.                if memo1.Text[n+3] in ['e','i'] then    //se la terza è una 'e' o una 'i' allora
  932.                 begin
  933.                  a.DeviceType:=dtautoselect;
  934.                  a.FileName:='suoni\'+voce+'\'+'doppia-'+'dolce-'+memo1.text[n+1]+'.wav';
  935.                  a.open;
  936.                  a.Wait:=true;
  937.                  a.Play;
  938.                 end
  939.                else   //se la terza non è nè una 'e', nè una 'i'
  940.                 begin
  941.                  a.DeviceType:=dtautoselect;
  942.                  a.FileName:='suoni\'+voce+'\'+'doppia-'+'dura-'+memo1.text[n+1]+'.wav';
  943.                  a.open;
  944.                  a.Wait:=true;
  945.                  a.Play;
  946.                 end;
  947.               end
  948.              else    //altrimenti se la seconda non è una g
  949.               begin
  950.                if memo1.Text[n+2] in ['l','n'] then   // se la seconda è una 'l' o una 'n' allora
  951.                 begin
  952.                  a.DeviceType:=dtautoselect;
  953.                  a.FileName:='suoni\'+voce+'\'+memo1.text[n+2]+'-'+memo1.text[n+1]+'.wav';
  954.                  a.open;
  955.                  a.Wait:=true;
  956.                  a.Play;
  957.                 end
  958.                else //altrimenti se la seconda non è ne una 'l' nè una 'n'
  959.                 begin
  960.                  if memo1.Text[n+2] in ['i','e'] then
  961.                   begin
  962.                    a.DeviceType:=dtautoselect;
  963.                    a.FileName:='suoni\'+voce+'\'+'dolce-'+memo1.text[n+1]+'.wav';
  964.                    a.open;
  965.                    a.Wait:=true;
  966.                    a.Play;
  967.                   end
  968.                  else
  969.                   begin
  970.                    a.DeviceType:=dtautoselect;
  971.                    a.FileName:='suoni\'+voce+'\'+'dura-'+memo1.text[n+1]+'.wav';
  972.                    a.open;
  973.                    a.Wait:=true;
  974.                    a.Play;
  975.                   end;
  976.                 end;
  977.               end;
  978.             end;
  979.           end
  980.          else// altrimenti se non è una 'g'
  981.           begin
  982.            if memo1.Text[n+1] in ['e','i'] then  //se è una 'e' o una 'i' allora
  983.             begin
  984.              if memo1.Text[n] in ['c','g'] then  // se la precedente è una 'c' o una 'g' allora
  985.               begin
  986.                if memo1.Text[n+1]='i' then // se la corrente è la 'i' allora
  987.                 begin
  988.                  if memo1.Text[n+2] in ['a','e','i','o','u'] then  // se la successiva è una vocale allora
  989.                   begin      //non fare niente
  990.                   end
  991.                  else      //altrimenti se la successiva non è una vocale
  992.                   begin
  993.                    a.DeviceType:=dtautoselect;
  994.                    a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  995.                    a.open;
  996.                    a.Wait:=true;
  997.                    a.Play;
  998.                   end;
  999.                 end
  1000.                else //altrimenti se la corrente non è la 'i' (e quindi è la 'e')
  1001.                 begin
  1002.                  a.DeviceType:=dtautoselect;
  1003.                  a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1004.                  a.open;
  1005.                  a.Wait:=true;
  1006.                  a.Play;
  1007.                end;
  1008.               end
  1009.              else  //altrimenti, se la precedente non è nè la 'c' ne la 'g'
  1010.               begin
  1011.                if memo1.Text[n]='l' then // se la precedente è la 'l' allora
  1012.                 begin
  1013.                  if memo1.Text[n-1]='g' then  //se la precedente della precedente è la 'g' allora
  1014.                   begin
  1015.                    if memo1.Text[n+1]='i' then  // se la corrente è la 'i' allora
  1016.                     begin
  1017.                      if memo1.Text[n+2] in ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] then    //se la successiva è una lettera dell'alfabeto allora
  1018.                       begin //non fare nulla
  1019.                       end
  1020.                      else    // altrimenti se la successiva non è una lettera dell'alfabeto
  1021.                       begin
  1022.                        a.DeviceType:=dtautoselect;
  1023.                        a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1024.                        a.open;
  1025.                        a.Wait:=true;
  1026.                        a.Play;
  1027.                       end;
  1028.                     end
  1029.                    else // altrimenti se la corrente non è la 'i' (e quindi è la 'e')
  1030.                     begin
  1031.                      a.DeviceType:=dtautoselect;
  1032.                      a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1033.                      a.open;
  1034.                      a.Wait:=true;
  1035.                      a.Play;
  1036.                     end;
  1037.                   end
  1038.                  else //altrimenti se la precedente della precedente non è la 'g'
  1039.                   begin
  1040.                    a.DeviceType:=dtautoselect;
  1041.                    a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1042.                    a.open;
  1043.                    a.Wait:=true;
  1044.                    a.Play;
  1045.                   end
  1046.                 end
  1047.                else //altrimenti se la precedente non è la 'l'
  1048.                 begin
  1049.                 a.DeviceType:=dtautoselect;
  1050.                 a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1051.                 a.open;
  1052.                 a.Wait:=true;
  1053.                 a.Play;
  1054.                end;
  1055.               end;
  1056.              end
  1057.            else
  1058.             begin   //altrimenti se non è ne la 'e', ne la 'i'
  1059.              if memo1.Text[n+1] in ['l','n'] then  //se è la 'l' o la 'n' allora
  1060.               begin
  1061.                if memo1.Text[n]in ['g',memo1.Text[n+1]] then //se la precedente è la 'g' o è la stessa lettera allora
  1062.                 begin    //non fare nulla
  1063.                 end
  1064.                else //altrimenti
  1065.                 begin
  1066.                  if memo1.text[n+2]=memo1.Text[n+1] then  //se la seconda è uguale alla lettera corrente (se è doppia)
  1067.                   begin
  1068.                    a.DeviceType:=dtautoselect;
  1069.                    a.FileName:='suoni\'+voce+'\'+'doppia-'+memo1.text[n+1]+'.wav';
  1070.                    a.open;
  1071.                    a.Wait:=true;
  1072.                    a.Play;
  1073.                   end
  1074.                  else  //altrimenti se non è doppia
  1075.                   begin
  1076.                    a.DeviceType:=dtautoselect;
  1077.                    a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1078.                    a.open;
  1079.                    a.Wait:=true;
  1080.                    a.Play;
  1081.                   end
  1082.                 end;
  1083.               end
  1084.              else //altrimenti se non è ne la 'l' ne la 'n'
  1085.               begin
  1086.                if memo1.Text[n+1]='u' then  //se è la 'u' allora
  1087.                 begin
  1088.                  if memo1.Text[n]='q' then  // se l aprecedente è la 'q' allora
  1089.                   begin  //non fare niente
  1090.                   end
  1091.                  else    //altrimenti, se la precedente non è la 'q'
  1092.                   begin
  1093.                    a.DeviceType:=dtautoselect;
  1094.                    a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1095.                    a.open;
  1096.                    a.Wait:=true;
  1097.                    a.Play;
  1098.                   end
  1099.                 end
  1100.                else //altrimenti se non è la 'u'
  1101.                 begin
  1102.                  if memo1.Text[n+1]='s' then  // se è la s allora
  1103.                   begin
  1104.                    if memo1.text[n+2]='c' then //se la seconda è la c  allora
  1105.                     begin
  1106.                      if memo1.text[n+3] in ['e','i'] then //se la terza è la e o la i   allora
  1107.                       begin
  1108.                        a.DeviceType:=dtautoselect;
  1109.                        a.FileName:='suoni\'+voce+'\'+'c-'+memo1.text[n+1]+'.wav';
  1110.                        a.open;
  1111.                        a.Wait:=true;
  1112.                        a.Play;
  1113.                       end
  1114.                      else //altrimenti se la terza non è ne la e ne la i
  1115.                       begin
  1116.                        a.DeviceType:=dtautoselect;
  1117.                        a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1118.                        a.open;
  1119.                        a.Wait:=true;
  1120.                        a.Play;
  1121.                       end
  1122.                     end
  1123.                    else   // altrimenti se la seconda non è la c
  1124.                     begin
  1125.                      if memo1.text[n+2]=memo1.Text[n+1] then //se la seconda è uguale alla prima (se è doppia) allora
  1126.                       begin
  1127.                        a.DeviceType:=dtautoselect;
  1128.                        a.FileName:='suoni\'+voce+'\'+'doppia-'+memo1.text[n+1]+'.wav';
  1129.                        a.open;
  1130.                        a.Wait:=true;
  1131.                        a.Play;
  1132.                       end
  1133.                      else
  1134.                       begin
  1135.                        if memo1.text[n]=memo1.text[n+1] then
  1136.                         begin
  1137.                         end
  1138.                        else
  1139.                         begin
  1140.                          a.DeviceType:=dtautoselect;
  1141.                          a.FileName:='suoni\'+voce+'\'+memo1.text[n+1]+'.wav';
  1142.                          a.open;
  1143.                          a.Wait:=true;
  1144.                          a.Play;
  1145.                         end;
  1146.                       end;
  1147.                     end;
  1148.                   end
  1149.                  else
  1150.                   begin
  1151.                    if memo1.Text[n+1]=' ' then //se è lo spazio
  1152.                     begin
  1153.                      a.DeviceType:=dtautoselect;
  1154.                      a.FileName:='suoni\'+voce+'\'+'spazio-'+memo1.text[n+1]+'.wav';
  1155.                      a.open;
  1156.                      a.Wait:=true;
  1157.                      a.Play;
  1158.                     end
  1159.                    else //altrmenti se non è lo spazio
  1160.                     begin
  1161.                      if memo1.Text[n+1] in ['è','é'] then
  1162.                       begin
  1163.                        a.DeviceType:=dtautoselect;
  1164.                        a.FileName:='suoni\'+voce+'\'+'aperto-e'+'.wav';
  1165.                        a.open;
  1166.                        a.Wait:=true;
  1167.                        a.Play;
  1168.                       end;
  1169.                     // showmessage('Il carattere: "'+memo1.text[n+1]+'" non è riconosciuto come valido');
  1170.                     end;
  1171.                   end;
  1172.                  end;
  1173.                end;
  1174.              end;
  1175.           end;
  1176.         end;
  1177.       end
  1178.     end;
  1179.   end;
  1180. //---------------------------------------------------------------------------------------
  1181.  end;
  1182.  end;
  1183. end;
  1184.  
  1185. procedure Tfrmmainform.RadioButton5Click(Sender: TObject);
  1186. begin
  1187. voce:='voce maschile';
  1188. image2.Visible:=false;
  1189. image1.Visible:=true;
  1190. end;
  1191.  
  1192. procedure Tfrmmainform.RadioButton6Click(Sender: TObject);
  1193. begin
  1194. voce:='voce femminile' ;
  1195. image2.Visible:=true;
  1196. image1.Visible:=false;
  1197. end;
  1198.  
  1199. procedure Tfrmmainform.FormCreate(Sender: TObject);
  1200. begin
  1201.  radiobutton1.checked:=true;
  1202.  radiobutton5.checked:=true;
  1203. end;
  1204.  
  1205. procedure Tfrmmainform.Button1Click(Sender: TObject);
  1206. var f:textfile;
  1207.     riga,testo,parz1,parola:string;
  1208.     n,s,conta,conta1:integer;
  1209. begin
  1210. listbox1.clear;
  1211.  if memo2.text[length(memo2.text)]<>' ' then
  1212.  memo2.Text:=memo2.Text+' ';
  1213.  testo:=memo2.Text;
  1214.  conta:=0;
  1215.  conta1:=0;
  1216.  ////
  1217.  for s:=0 to length(memo2.Text) do   //mette in fila tutte le parole
  1218.   begin                             //dentro una listbox in modo
  1219.    if  memo2.Text[s]<>' ' then      // da poter essere molto più
  1220.     begin                           // facilmente confrontate
  1221.      conta:=conta+1;                // quando si deve verificare
  1222.     end                            //se la pronuncia della parola
  1223.    else                            // era gia stata impostata al bot
  1224.     begin
  1225.     parola:=lowercase(copy(memo2.Text,conta1,conta));
  1226.      listbox1.Items.Add(trim(parola)); //per precauzione si usa trim perchè non devono esserci spazi
  1227.      if parola<>' ' then
  1228.      listbox1.Items.add(' ');
  1229.      conta1:=conta1+conta+1;
  1230.      conta:=0;
  1231.      memo2.Refresh;
  1232.     end
  1233.   end;
  1234.  for s:=0 to listbox1.Count-1 do            //dopo che le parole sono state
  1235.   begin                                       //messe in fila, inizia a scorrere
  1236.    listbox1.itemindex:=listbox1.itemindex+1;  //riga per riga, tutta la listbox
  1237.    parz1:=listbox1.Items[listbox1.itemindex];  // e riconosce le parole insegnate da quelle non insegnate
  1238.  
  1239.     ////
  1240.    if not(fileexists('insegnamenti\'+parz1+'.ssr')) then //se la parola non è stata insegnata allora vai in modalità automatico o manuale
  1241.     begin
  1242.      memo1.Text:=parz1;
  1243.      button5.Click;
  1244.     end
  1245.    else    //altrimenti, se la parola è stata insegnata
  1246.     begin    // la pronuncia con gli insegnamenti impostati
  1247.      //showmessage(''''+parz1+'''');
  1248.       assignfile(f,'insegnamenti\'+parz1+'.ssr');
  1249.       reset(f);
  1250.       stringgrid1.RowCount:=length(parz1);
  1251.       n:=-1;
  1252.       while not seekeof(f) do
  1253.        begin
  1254.         n:=n+1;
  1255.         read(f,riga);
  1256.         stringgrid1.Cells[1,n]:=(riga)
  1257.        end;
  1258.        for n:=0 to length(parz1) do
  1259.         stringgrid1.Cells[0,n]:=parz1[n+1];
  1260.         closefile(f);
  1261.         for n:=0 to stringgrid1.RowCount-1 do
  1262.          begin
  1263.           if not(stringgrid1.Cells[1,n]='none') then
  1264.            begin
  1265.             a.DeviceType:=dtautoselect;
  1266.             if stringgrid1.Cells[1,n]='#' then
  1267.              begin
  1268.             // showmessage('suoni\'+voce+'\'+stringgrid1.cells[0,n]+'.wav');
  1269.              a.FileName:='suoni\'+voce+'\'+stringgrid1.cells[0,n]+'.wav'
  1270.              end
  1271.             else
  1272.             begin
  1273.            // showmessage('suoni\'+voce+'\'+stringgrid1.Cells[1,n]+stringgrid1.cells[0,n]+'.wav');
  1274.             a.FileName:='suoni\'+voce+'\'+stringgrid1.Cells[1,n]+stringgrid1.cells[0,n]+'.wav';
  1275.             end;
  1276.             a.open;
  1277.             a.Wait:=true;
  1278.             a.Play;
  1279.            end;
  1280.          end;
  1281.      end
  1282.    end;
  1283. end;
  1284.  
  1285. procedure Tfrmmainform.Button3Click(Sender: TObject);
  1286. begin
  1287.  halt;
  1288. end;
  1289.  
  1290. procedure Tfrmmainform.Button4Click(Sender: TObject);
  1291. begin
  1292.  memo2.clear;
  1293. end;
  1294.  
  1295. procedure Tfrmmainform.Button6Click(Sender: TObject);
  1296. var n:integer;
  1297. begin
  1298.  frmfonetica.radiobutton18.Checked:=true;
  1299.   frmfonetica.groupbox1.Visible:=false;
  1300.  for n:=0 to stringgrid1.rowcount-1 do
  1301.   begin
  1302.    frmfonetica.stringgrid1.cells[1,n]:='';
  1303.    frmfonetica.stringgrid1.Cells[2,n]:='';
  1304.   end;
  1305.    frmfonetica.stringgrid1.RowCount:=1;
  1306.    frmfonetica.listbox2.Visible:=true;
  1307.    frmfonetica.combobox1.Visible:=false;
  1308.    frmfonetica.listbox1.visible:=false;
  1309.    frmfonetica.edit1.clear;
  1310.    frmfonetica.listbox2.clear;
  1311.    frmfonetica.button3.Visible:=false;
  1312.    frmfonetica.button2.visible:=true;
  1313.    frmfonetica.stringgrid2.visible:=true;
  1314.    frmfonetica.stringgrid1.Visible:=false;
  1315.    frmfonetica.button3.enabled:=false;
  1316.    frmfonetica.button2.enabled:=false;
  1317.    frmfonetica.button4.Visible:=true;
  1318.    frmfonetica.groupbox6.Visible:=true;
  1319.   frmfonetica.showmodal;
  1320. end;
  1321.  
  1322. end.