Bonsoir a tous,
Voila je viens de me rendre compte que la fonction Goto Batch ne marche pas avec se Code
Exemple se code Batch (Inséré dans le (MEMO = 'Bach') (Probléme ":boucle")
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 function ConstructorBatch(Batch: TMemo): String; const Sub = '&&'; var I: Integer; Cmd: String; begin Result := ''; for I := 0 to Batch.Lines.Count - 1 do begin Cmd := Cmd + Batch.Lines.Strings[I] + Sub; end; Result := Copy(Cmd,0, Length(Cmd) -2); end; procedure TForm1.btn_ExecuterClick(Sender: TObject); Var aCmdLine : PChar; begin aCmdLine := PChar(cmdSwitch + ConstructorBatch(Batch)); StatusBar1.SimpleText := aCmdLine; Case cb_FenetreDos.Checked of True :ShellExecute(Handle, nil, 'CMD', aCmdLine, nil, sw_ShowNormal); False :ShellExecute(Handle, nil, 'CMD', aCmdLine, nil, sw_Hide); end; end; procedure TForm1.RadioButton1Click(Sender: TObject); begin CmdSwitch := CmdSwitchs[TRadioButton(Sender).tag] ; if RadioButton2.Checked Then With cb_FenetreDos do Begin Checked := True; Enabled := False; End Else cb_FenetreDos.Enabled := True; end; procedure TForm1.FormShow(Sender: TObject); begin RadioButton2.Checked := True; end;
Erreur de la console : la syntax du nom de fichier de repertoire ou de volume est incorrecte.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 @title << Batch >> @set t=0 :boucle cls @color %t% @echo ------------------ @echo ---- CADRE ------ @echo ------------------ echo %t% @set /a t = t + 1 if %t%==99 goto fin goto boucle :fin pause
Alors j'ai tester se code batch directement dans un fichier *.bat est la marche
Auriez vous une idée doux pourrai venir le problème ?
Merci de votre réponse & Bonne fête de fin d'année
Partager