Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   FreePascal (https://www.delphipraxis.net/74-freepascal/)
-   -   Wohin mit der Funktion? (https://www.delphipraxis.net/188125-wohin-mit-der-funktion.html)

Wolfgang Mix 2. Feb 2016 17:55

Wohin mit der Funktion?
 
program Gregor;
var
a,b,c,d,e,f,k,k2,t,m,n,j,jh,jz,wt: Integer;wts:string;
begin
//
//
//
function isleapyear(year):Boolean;
begin
//
//
//
end;


end.

//Free Pascal Online Compiler [fpc-2.6.4]
Copyright (c) Florian Klaempfl and others

Compiling your program...

prog.pas(8,1) Error: Illegal expression
prog.pas(8,10) Fatal: Syntax error, ";" expected but "identifier ISLEAPYEAR" found
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

p80286 2. Feb 2016 18:01

AW: Wohin mit der Funktion?
 
Delphi-Quellcode:
function isleapyear(year:word):Boolean;
versuch's mal so.

Gruß
K-H

Wolfgang Mix 2. Feb 2016 18:05

AW: Wohin mit der Funktion?
 
Gleiche Fehlermeldungen :oops:

Klaus01 2. Feb 2016 18:12

AW: Wohin mit der Funktion?
 
.. vielleicht so?

Code:
program Gregor;
var
a,b,c,d,e,f,k,k2,t,m,n,j,jh,jz,wt: Integer;wts:string;

  function isleapyear(year: word):Boolean;
   begin
    //
    //
    //
   end;


begin
//
//
//


end.
Grüße
Klaus

nahpets 2. Feb 2016 18:12

AW: Wohin mit der Funktion?
 
'ne Funktionsdeklaration gehört vor das begin und nicht in den Bereich zwischen begin und end.

Wolfgang Mix 2. Feb 2016 18:16

AW: Wohin mit der Funktion?
 
Free Pascal Online Compiler [fpc-2.6.4]
Copyright (c) Florian Klaempfl and others

Compiling your program...

prog.pas(1,5) Fatal: Syntax error, "BEGIN" expected but "identifier CODE" found
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

mjustin 2. Feb 2016 18:26

AW: Wohin mit der Funktion?
 
FPC unterstützt verschiedene Pascal Dialekte. Für diesen Code würde ich den Delphi Modus wählen, entweder in den Projektoptionen oder mit {$MODE DELPHI} am Anfang des Programms.

DeddyH 2. Feb 2016 18:26

AW: Wohin mit der Funktion?
 
Vielleicht so?
Delphi-Quellcode:
program Gregor;

function isleapyear(year: word): Boolean;
begin
  //
end;

procedure main;
var
  a,b,c,d,e,f,k,k2,t,m,n,j,jh,jz,wt: Integer;
  wts: string;
begin
  //
end;

begin
  main;
end.

Wolfgang Mix 2. Feb 2016 19:33

AW: Wohin mit der Funktion?
 
@ Detlef
Free Pascal Online Compiler [fpc-2.6.4]
Copyright (c) Florian Klaempfl and others

Compiling your program...

prog.pas(11,1) Note: Local variable "a" not used
prog.pas(11,3) Note: Local variable "b" not used
prog.pas(11,5) Note: Local variable "c" not used
prog.pas(11,7) Note: Local variable "d" not used
prog.pas(11,9) Note: Local variable "e" not used
prog.pas(11,11) Note: Local variable "f" not used
prog.pas(11,13) Note: Local variable "k" not used
prog.pas(11,15) Note: Local variable "k2" not used
prog.pas(11,18) Note: Local variable "t" not used
prog.pas(11,20) Note: Local variable "m" not used
prog.pas(11,22) Note: Local variable "n" not used
prog.pas(11,24) Note: Local variable "j" not used
prog.pas(11,26) Note: Local variable "jh" not used
prog.pas(11,29) Note: Local variable "jz" not used
prog.pas(11,32) Note: Local variable "wt" not used
prog.pas(11,44) Note: Local variable "wts" not used
prog.pas(18,4) Fatal: Syntax error, ";" expected but "." found
Fatal: Compilation aborted



@ mjustin
Der Compilerschalter akzeptiert zumindest die Funktion, wenn ich result:= einfüge,
Fehlermeldungen bleiben

Es ist zum Mäusemelken

Lt.. Manual gehört die Prozedur ins HP. Geht aber nicht.
Verschiebung oberhalb von program geht sucht nicht!

Ich will TP7 for IPad :oops::oops::cry:

Wolfgang Mix 2. Feb 2016 21:27

AW: Wohin mit der Funktion?
 
Ich habe es:firejump::bounce1::bounce1:bounce1:

So will der Compiler:

{$Mode Delphi}
program Gregor;
uses crt;
var
a,b,c,d,e,f,k,k2,t,m,n,j,jh,jz,wt: Integer;wts:string;

function isleapyear(year:word):Boolean;
begin
result:=true;
end;

begin

end.

Free Pascal Online Compiler [fpc-2.6.4]
Copyright (c) Florian Klaempfl and others

Compiling your program...
Build completed successfully!
Running your program...
The program executed successfully!


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:52 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz