Bonjour,
Je souhaite remplacer le caractère point par le caractère virgule dans un TEdit
Je sais le faire avec TP7 mais il ne fonctionne avec Windows que sous DOSbox ou Virtual Machine ce qui n'est pas pratique pour le partage.
voici mon essais:
dans cet essais le point n'est pas remplacé et Delphi me le signale en erreur, quelle procédure adopter ?
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 {---------------------------------------------------------} procedure TTL431_Vref_OUT.CalculClick(Sender: TObject); var hlf,Vs,Vo,R,Rx,Rs,Ia,It: Real; ln,ct: integer; Ch:PAnsiChar ; begin ln := 0; Ch := PAnsiChar(Edit2.Text); ct:= StrLen (Ch); if ln <= ct then begin if CH = #46 then Ch := #44; Edit2.Text := PAnsiChar(Ch); end; Vs := StrToFloat(edit1.Text); Vo := StrToFloat(edit2.Text); R := StrToFloat(edit3.Text); Ia:= StrToFloat(edit4.Text)/1000; hlf:= (Vo/2.5)-1; {half} Rx:= R/hlf; Vo:=(2.5/Rx)*(R+Rx); Rs:= (Vs-Vo)/Ia; Ia:=Ia; It:= ((Vo/(R+Rx)+Ia)); Vsup.Caption:=FloatToStr(Vs); Vout.Caption:=FloatToStr(Vo); R2.Caption:=FloatToStrf(Rx,ffFixed,7,2); Iak.Caption:=FloatToStr(Ia*1000); Rsup.Caption:=FloatToStrf(Rs,ffFixed,6,2); I_Total.Caption:=FloatToStrf(It*1000,ffFixed,2,5); end; end.
Partager