Autor Beitrag
curtiss
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59



BeitragVerfasst: Mo 07.01.08 16:54 
hi,

folgendes
ausblenden 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:
var
  Form1: TForm1;
  sql : array of string;
  ora : array of string;

implementation

{$R *.dfm}
function convert_line(line : string; ora:boolean):string;
var
i : integer;
begin
  if ora then  
    begin
      for i := 0 to high(sql) do
      begin
        line := stringreplace(line,sql[i],ora[i],[rfReplaceAll, rfIgnoreCase]);
      end;
    end
  else
    begin
      for i := 0 to high(sql) do
      begin
        line := stringreplace(line,ora[i],sql[i],[rfReplaceAll, rfIgnoreCase]);
      end;
  end;
  convert_line := line;
end;


compiler :
[Fehler] sql_ora.pas(49): Array-Typ erforderlich
[Fehler] sql_ora.pas(56): Array-Typ erforderlich
[Fataler Fehler] sql_ora.pas(7): Verwendete Unit 'sql_ora' kann nicht compiliert werden


was zur hölle will er von mir ?
curtiss Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59



BeitragVerfasst: Mo 07.01.08 17:00 
hups, hab ja ganz vergessen zu sagen wo er meckert :

zeile 17 und 24 jeweils bei dem ora array!
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mo 07.01.08 17:01 
user profile iconcurtiss hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
  if ora then					

Ich vermisse den Fehler "Boolean-Ausdruck erwartet, Arraytyp erhalten" (sinngemäß).
HALT! Fehler gefunden. Die allseits verhassen Globalen Variablen sind's.
Du glaubst, auf den globalen Array ora zuzugreifen, aber in wirklichkeit greifst du auf den lokalen Funktionsparameter ora : Boolean zu. Das ist kein Array, und darum lösen die [] einen Fehler aus.
darum wo immer es geht auf globale Variablen verzichten!

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
curtiss Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59



BeitragVerfasst: Mo 07.01.08 17:03 
ach du schande! danke ! da wär ich im leben nicht drauf gekommen !
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mo 07.01.08 17:05 
user profile iconcurtiss hat folgendes geschrieben:
da wär ich im leben nicht drauf gekommen !
Richtig. Fehler durch Gültigkeitsbereiche von globalen Variablen sind irgendwann so unübersichtlich, dass man, bei größeren Programmen, um das komplette neu-Schreiben nicht drum rum kommt - und das nur, weil man globale Variablen eingesetzt hat :(

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.