![]() |
Re: Couldn't convert varient of type (NULL) into type (Strin
Delphi-Quellcode:
if not Query2.FieldValues['WER'].isNull then ... else ...
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Ich hab das jetzt so gemacht:
Delphi-Quellcode:
Aber entweder bin ich zu blöd zu kapieren, wie das funktioniert oder es klappt so wirklich nicht..
hcode2:='<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+if not Query2.FieldValues['WER'].isNull then Query2.FieldValues['WER'] else empty+'</font></td>';
Zitat:
|
Re: Couldn't convert varient of type (NULL) into type (Strin
So geht es natürlich nicht.
Delphi-Quellcode:
function CheckNull( Field: TField; eValue: Variant):Variant;
begin if not Field.isNull then result := Field.Value else result := eValue; end; ... hcode:='<tr>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('KLASSEN'], 'empty'))+... |
Re: Couldn't convert varient of type (NULL) into type (Strin
Danke soweit schonmal!
Bin irgendwie immer noch nicht so ganz ausm PHP-Konzept raus.. Leider bekomme ich den gleichen fehler mit dem NULL-Dingens immer noch..:( Ich habe alles nach deinem Schema umgebaut.
Delphi-Quellcode:
Das erste Feld, welches leer (also nil) ist, wäre 'WER'. Und genau in der Zeile befindet sich dann auch wieder der Ausgabefehler.
hcode:='<tr>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('KLASSEN'), 'empty')+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('S'), 'empty')+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('FUER'), 'empty')+'</font></td>'+sLineBreak;
WriteLn(Datei, hcode); hcode2:='<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('WER'), 'empty')+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('FACH'), 'empty')+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('RAUM'), 'empty')+'</font></td>'+sLineBreak+'<td width=37% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+CheckNull(Query2.FieldByName('BEMER_SCH'), 'empty')+'</font></td>'+sLineBreak+'</tr>'; WriteLn(Datei, hcode2); |
Re: Couldn't convert varient of type (NULL) into type (Strin
Hast du mal im Debugger geschaut, wo dieser Fehler auftritt?
|
Re: Couldn't convert varient of type (NULL) into type (Strin
In der Zeile wo hcode2 geschrieben werden sollte.
|
Re: Couldn't convert varient of type (NULL) into type (Strin
In meiner Funktion
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Es ist genau die gleiche Stelle, wie vor dem Einbau deiner Funktion.
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Nein schau dir mal der Ablauf in der Funktion an.
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Sry wenn ich jetzt so blöd frage, aber..
wo gennau? :D Da gibts ziemlich viele Debugwindows.. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:32 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz