Autor Beitrag
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Sa 02.08.08 15:48 
HI,

ich habe ein Problem mit folgendem Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var CtrlPoints2D: array[0..3,0..3,0..2] of Single; //4x4 Pkt mit je 3 Koordinaten

procedure LoadCtrlPoints;
var
u, v : Integer;
F : Text;
begin
  AssignFile(F, 'surface.txt');
  Reset(F);
  FillChar(CtrlPoints2D[0,0,0], SizeOf(CtrlPoints2D), 0);
  for u := 0 to 3 do
    for v := 0 to 3 do
      ReadLn(F, CtrlPoints2D[u,v,0], CtrlPoints2D[u,v,1], CtrlPoints2D[u,v,2]); //fehler
  CloseFile(F)
end;


die surface.txt hat folgenden inhalt:
ausblenden Quelltext
1:
2:
3:
4:
-1.5 2.0 -1.5
-0.5 -1.0 -1.5
0.5 -1.0 -1.5
...


und zwar kommt an besagter stelle dieser Fehler:
[Fehler] Unit1.pas(35): Inkompatible Typen: 'procedure, untyped pointer or untyped parameter' und 'Single'

weiß jmd wie ich das beheben kann? schonma danke im vorraus...

MfG Bergmann.

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^


Zuletzt bearbeitet von Bergmann89 am So 03.08.08 01:05, insgesamt 2-mal bearbeitet
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Sa 02.08.08 16:00 
F ist Textdatei. Dann muss es prinzipiell so heißen : readln (F,st); wobei st ein string ist. Ich nehme aber an, du brauchst die 3 Werte ? Man könnte entweder den string zerlegen, oder direkt statt Textfile typisierte Dateien verwenden.

_________________
Gruß
Hansa
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Sa 02.08.08 16:19 
sry, hab grad n fehler gefunden: F hab ich nich als Text sondern als File deklariert
also var F: File;

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Sa 02.08.08 18:40 
user profile iconBergmann89 hat folgendes geschrieben:
sry, hab grad n fehler gefunden: F hab ich nich als Text sondern als File deklariert


...und wegen Editierens der Ausgangsfrage nach Erhalt einer Antwort diese nahezu unbrauchbar zur Beantwortung gemacht. Inklusive der Antwort. Toll. :zustimm: :mrgreen: Das gesagte bleibt allerdings im Prinzip richtig.

_________________
Gruß
Hansa
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: So 03.08.08 01:04 
sorry ^^
ich änders wieder um. aber im prinzip hab ich ja geschrieben was ich geändert hab...

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^