Thema: Excel Sheets

Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.211 Beiträge
 
Delphi 12 Athens
 
#15

AW: Excel Sheets

  Alt 4. Okt 2016, 16:19
Durch die vielen (NOT VarIsEmpty( wurde es etwas unübersichtlich..
Zitat:
Delphi-Quellcode:
  if ((NOT VarIsEmpty(oExcel))and(NOT VarIsEmpty(oWB1))
      and(NOT VarIsEmpty(oWS1))and(NOT VarIsEmpty(oWS2))) then
Ein bissl Boolesche Algebra und viele NOT sind Geschichte.

Erstmal die obsoleten Klammern weg (außerdem können Leerzeichen ja soooooooowas von entspannend wirken)
Ich werde da immer ganz kirre, wenn ich sinnlos Klammern zählen muß, um zu erkennen was wirklich geklammert ist. (wir schreiben hier doch keine C-Codes, wo immer zuviele Klammern vorkommen und ich die gern mal mit { } verwechsle )
Delphi-Quellcode:
  if NOT VarIsEmpty(oExcel) and NOT VarIsEmpty(oWB1)
      and NOT VarIsEmpty(oWS1) and NOT VarIsEmpty(oWS2) then
und dann nur noch umdrehn
  if NOT (VarIsEmpty(oExcel) or VarIsEmpty(oWB1) or VarIsEmpty(oWS1) or VarIsEmpty(oWS2)) then
Warum NOT groß und IF THEN AND klein?
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests

Geändert von himitsu ( 4. Okt 2016 um 16:23 Uhr)
  Mit Zitat antworten Zitat