Visualizzazione dei risultati da 1 a 2 su 2

Discussione: (Delphi 7) Formula

  1. #1

    (Delphi 7) Formula

    codice:
    procedure TTriOnOff1.Button2Click(Sender: TObject);
    var
    X,Y,Z:INTEGER;
    S:STRING[10];
    nDouble: Double;
    begin
      VAL(corrente.text,X,Z);
      VAL(hfe.text,Y,Z);
      nDouble := StrToFloatDef(Volt.text, 0);
      nDouble := (nDouble - 0.7) / (X / (Y / 3);
      STR(X,S);
      Label1.Caption := FloatToStr(Round(nDouble));
      VAL(corrente.text,X,Z);
      nDouble := StrToFloatDef(Volt.text, 0);
      nDouble := nDouble * ( X / 1000 );
      STR(X,S);
      Label22.Caption := FormatFloat('#0.##', nDouble);
    end;
    end.
    Con questa riga:
    codice:
    nDouble := (nDouble - 0.7) / (X / (Y / 3);
    dovrei eseguire questa formula matematica:
    (5-0.7) / (30 / (20 / 3)
    ma mi da questo errore:
    [Error] TriOnOff.pas(45): ')' expected but ';' found
    dove sbaglio?

  2. #2
    Moderatore di Programmazione L'avatar di alka
    Registrato dal
    Oct 2001
    residenza
    Reggio Emilia
    Messaggi
    24,472
    Originariamente inviato da camaleonteplus
    dovrei eseguire questa formula matematica:
    (5-0.7) / (30 / (20 / 3)
    Non faccio matematica da tanto tempo ormai, e avevo bruttissimi voti, ma da quel poco che mi ricordo so che le parentesi aperte devono coincidere con quelle chiuse...
    MARCO BREVEGLIERI
    Software and Web Developer, Teacher and Consultant

    Home | Blog | Delphi Podcast | Twitch | Altro...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.