AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Wohin mit der Funktion?

Ein Thema von Wolfgang Mix · begonnen am 2. Feb 2016 · letzter Beitrag vom 3. Feb 2016
Antwort Antwort
Seite 1 von 2  1 2      
Benutzerbild von Wolfgang Mix
Wolfgang Mix

Registriert seit: 13. Mai 2009
Ort: Lübeck
1.222 Beiträge
 
Delphi 2005 Personal
 
#1

Wohin mit der Funktion?

  Alt 2. Feb 2016, 17:55
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)
Wolfgang Mix
if you can't explain it simply you don't understand it well enough - A. Einstein
Mein Baby:http://www.epubli.de/shop/buch/Grund...41818516/52824
  Mit Zitat antworten Zitat
Benutzerbild von p80286
p80286

Registriert seit: 28. Apr 2008
Ort: Stolberg (Rhl)
6.659 Beiträge
 
FreePascal / Lazarus
 
#2

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 18:01
function isleapyear(year:word):Boolean; versuch's mal so.

Gruß
K-H
Programme gehorchen nicht Deinen Absichten sondern Deinen Anweisungen
R.E.D retired error detector
  Mit Zitat antworten Zitat
Benutzerbild von Wolfgang Mix
Wolfgang Mix

Registriert seit: 13. Mai 2009
Ort: Lübeck
1.222 Beiträge
 
Delphi 2005 Personal
 
#3

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 18:05
Gleiche Fehlermeldungen
Wolfgang Mix
if you can't explain it simply you don't understand it well enough - A. Einstein
Mein Baby:http://www.epubli.de/shop/buch/Grund...41818516/52824
  Mit Zitat antworten Zitat
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.754 Beiträge
 
Delphi 10.4 Sydney
 
#4

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 18:12
.. 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
Klaus

Geändert von Klaus01 ( 2. Feb 2016 um 18:23 Uhr)
  Mit Zitat antworten Zitat
nahpets
(Gast)

n/a Beiträge
 
#5

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 18:12
'ne Funktionsdeklaration gehört vor das begin und nicht in den Bereich zwischen begin und end.
  Mit Zitat antworten Zitat
Benutzerbild von Wolfgang Mix
Wolfgang Mix

Registriert seit: 13. Mai 2009
Ort: Lübeck
1.222 Beiträge
 
Delphi 2005 Personal
 
#6

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 18:16
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)
Wolfgang Mix
if you can't explain it simply you don't understand it well enough - A. Einstein
Mein Baby:http://www.epubli.de/shop/buch/Grund...41818516/52824
  Mit Zitat antworten Zitat
mjustin

Registriert seit: 14. Apr 2008
3.004 Beiträge
 
Delphi 2009 Professional
 
#7

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 18:26
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.
Michael Justin
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.537 Beiträge
 
Delphi 11 Alexandria
 
#8

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 18:26
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.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Benutzerbild von Wolfgang Mix
Wolfgang Mix

Registriert seit: 13. Mai 2009
Ort: Lübeck
1.222 Beiträge
 
Delphi 2005 Personal
 
#9

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 19:33
@ 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
Wolfgang Mix
if you can't explain it simply you don't understand it well enough - A. Einstein
Mein Baby:http://www.epubli.de/shop/buch/Grund...41818516/52824

Geändert von Wolfgang Mix ( 2. Feb 2016 um 20:09 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von Wolfgang Mix
Wolfgang Mix

Registriert seit: 13. Mai 2009
Ort: Lübeck
1.222 Beiträge
 
Delphi 2005 Personal
 
#10

AW: Wohin mit der Funktion?

  Alt 2. Feb 2016, 21:27
Ich habe esbounce1:

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!
Wolfgang Mix
if you can't explain it simply you don't understand it well enough - A. Einstein
Mein Baby:http://www.epubli.de/shop/buch/Grund...41818516/52824
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:08 Uhr.
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