Autor Beitrag
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 27.05.03 15:08 
hi ich hab hier ne procedure die einen string als eingabeparameter erwartet.

ausblenden Delphi-Quelltext
1:
procedure SplitData(DataSet : string);					


nun übergebe ich an diese procedure einen wert da dieser in der procedure umgewandelt werden soll und anschliessend in die datenbank geschrieben werden soll.


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
  for i := trunc(start) to trunc(endate) do
  begin
    alu.opent.tablename := 'OPCLD';
    alu.opent.open;
    alu.opent.append;
    alu.opent.FieldValues['OPNAME'] := 'ADVTIME';
    alu.opent.FieldValues['OP_TS'] := opts;
    alu.opent.FieldValues['CAL_ID'] := Name;
    alu.opent.FieldValues['DATESPEC'] := UUpdate.SplitData(DateTimeToStr(i));//hier wird sie aufgerufen
    alu.opent.FieldValues['OPSTART'] := '08:00';
    alu.opent.FieldValues['OPFINISH'] := '16:00';
    alu.opent.FieldValues['OPWORK'] := 'F';
    alu.opent.post;
    alu.opent.close;
    opts := opts +1;
  end;//for



darauf folgt wenn ich coilieren will diese fehler meldung

ausblenden Quelltext
1:
[Fehler] RWDb.pas(229): Inkompatible Typen: 'Variant' und 'procedure, untyped pointer or untyped parameter'					


kann mir jemand helfen?

gr€€tz
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Di 27.05.03 15:29 
Hallo,
ich denke es würde helfen, wenn du mal den Source der Procedure angibst!
mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Luncustaf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 27.05.03 15:44 
hi,

hier die source

ausblenden volle Höhe Delphi-Quelltext
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:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
procedure TUpdate.SplitData(DataSet: string);
var
i, a : integer;
DataSetLength, x : integer;
StartDate, EndDate, Name, FirstDate, SecondDate : string;
begin
  StartDate:='20';
  EndDate := '20';
  x := -1;
  DataSetLength := length(DataSet);
  for i := DataSetLength downto 1 do
  begin
    if (i > DataSetLength -8) then
    begin
      if (DataSet[i] = '.') then
      begin
        EndDate := EndDate+SecondDate;
        SecondDate := '';
      end
      else begin
         SecondDate := DataSet[i]+SecondDate;
         if (i = DataSetLength -7) then
            EndDate := EndDate+SecondDate;
      end;//if
    end;//if
    if (i < DataSetlength -7) and (i > DataSetLength -16) then
    begin
      if (DataSet[i] = '.') then
      begin
        StartDate := StartDate+FirstDate;
        FirstDate := '';
      end
      else begin
         FirstDate := DataSet[i]+FirstDate;
         if (i=DataSetLength-15) then
           StartDate := StartDate+FirstDate;
      end;
    end;//if
    if (i < DataSetLength -15) then
    begin
      Name := DataSet[i]+Name;
    end;//if
  end;//for
  Name := SyncNames(Trim(Name));
  SetLength(Oldeststart, length(OldestStart)+1);
  SetLength(Period, length(Period)+1);
  for a := 0 to high(OldestStart) do
  begin
    if (OldestStart[a].Name = Name) then
    begin
      x := 1;
      if OldestStart[a].Datum > StartDate then
      begin
        OldestStart[a].Datum := StartDate;
      end;
    exit;
    end
    else begin
      x := 0;
    end;//if
  end;//for
  if x = 0 then
  begin
    OldestStart[high(OldestStart)].Name := Name;
    OldestStart[high(OldestStart)].Datum := StartDate;
  end;
  i := length(period)-1;
  Period[i].Name := Name;
  Period[i].StartDate := StartDate;
  Period[i].EndDate := EndDate;
end;
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Di 27.05.03 15:56 
Hab´den Fehler gefunden:
deine Prozedur muss eine Funktion sein!
Du versuchst einem Wert eine Prozedure zuzuweisen, also
eine Funktion erstellen die als result, den umgerechneten Wert zurückliefert.

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Luncustaf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 27.05.03 16:03 
i,

hmpf das kagga weil ich kann dir procedure net zu einer funktion machen da ich die prozedure noch an einer anderen stellei m programm brauche :/ hmpf das echt kagga ;/


muss mir was einfallen alssen thx anyway.

gr€€tz
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 27.05.03 16:15 
Es zwingt dich doch keiner den Rückgabewert zu verarbeiten. Oder sehe ich da jetzt was falsch?
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Di 27.05.03 16:30 
Nein, muss er nicht er kann eine Funktion auch so deklarieren:function MyFunc(param1: integer): integer;und sie im Code dann einfach so aufrufen, ohne Auswertung:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var i: integer;
begin
 i := MyFunc(2);
 //Es geht aber auch so:
 MyFunc(2);
end;


mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)