AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?
Thema durchsuchen
Ansicht
Themen-Optionen

Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

Ein Thema von Rollo62 · begonnen am 22. Nov 2023 · letzter Beitrag vom 24. Nov 2023
Antwort Antwort
DenkDirNix

Registriert seit: 13. Dez 2018
71 Beiträge
 
Delphi 11 Alexandria
 
#1

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 23. Nov 2023, 11:15
Hast Du die Unit eventuell aus einer älteren Delphi-Version heraus kopiert und nicht aus der mit der Du übersetzt?
  Mit Zitat antworten Zitat
Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.609 Beiträge
 
Delphi 12 Athens
 
#2

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 23. Nov 2023, 11:47
Also ich kann das hier problemlos machen.

Oder hast du in deinem Projekt zufällig ein GENERICVARIANTS in den Defines? Denn nur dann wird ein uses System.Variants in System.VarUtils aktiviert.
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat
Rollo62

Registriert seit: 15. Mär 2007
4.164 Beiträge
 
Delphi 12 Athens
 
#3

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 23. Nov 2023, 20:03
Ich habe das in einem größeren Projekt versucht, ich versuche es morgen nochmal mit einem leeren Projekt.
Die normalen Debug-DCU's sind aktiv, es ist nichts an den Settings verstellt, ich kann also den Source normal debuggen.
Nein, ist auch nicht aus einem älternen Projekt, sondern aus dem Delphi/Source Verzeichnis, mit dem ich auch testen möchte.
  Mit Zitat antworten Zitat
Rollo62

Registriert seit: 15. Mär 2007
4.164 Beiträge
 
Delphi 12 Athens
 
#4

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 24. Nov 2023, 13:18
Hallo Uwe,

ich habe es nochmal mit einem ganz leeren Projekt versucht, nur die System.Variants Unit lokal.
Das kompiliert nicht bei mir, weder für Win32 noch für Android32/64.

Immer mit dem Fehler
"[dcc32 Fatal Error] System.Variants.pas(1271): E2158 System.Variants unit out of date or corrupted: missing '@VarCast'"

Falls das so, ohne weiteres bei Dir kompiliert, dann wüsste ich gerne warum das hier nicht funktioniert.
Ich habe eigentlich ein ziemlich natives RadStudio 11.3, mit nur ein paar Tools geladen (TestInsight, Kastri ) sonst eigentlich nur Sourcen.

Der ursprüngliche Grund, warum ich das laden wollte, hat sich mittlerweile erledigt.
Allerdings wäre es interessant zu wissen warum es mal geht und mal nicht.

Hier ist mein minimales Testprojekt:
T489_TstSysUnit_001.zip
  Mit Zitat antworten Zitat
Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.609 Beiträge
 
Delphi 12 Athens
 
#5

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 24. Nov 2023, 13:41
In deinem originalen Post ging es aber nicht um System.Variants, sondern um System.VarUtils.

Bei System.Variants bekomme ich auch den gleichen Fehler.
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
386 Beiträge
 
#6

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 24. Nov 2023, 13:48
Immer mit dem Fehler
"[dcc32 Fatal Error] System.Variants.pas(1271): E2158 System.Variants unit out of date or corrupted: missing '@VarCast'"
VarCast is declared as _VarCast, so in theory to make it work you need to strip all the functions in System.Variants.pas from these and adjust the whole unit to call them stripped code, though there might be something hidden to surprise you, which need to adjust system.pas itself, that most likely impossible with Delphi compiler.

If rebuilding the whole RTL (after making changes) is possible then that is the right way, in my opinion.
In case you succeeded in rebuilding the RTL, then i suggest to add global hooks with minimum interaction with the current code and declarations, these hooks and callback can be used for logging, and the RTL might still be compatible with default RTL, just food for thought.
Kas
  Mit Zitat antworten Zitat
Rollo62

Registriert seit: 15. Mär 2007
4.164 Beiträge
 
Delphi 12 Athens
 
#7

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 24. Nov 2023, 18:25
In deinem originalen Post ging es aber nicht um System.Variants, sondern um System.VarUtils.
Ja sorry, ich hatte beide probiert um die fehlende Referenzen reinzubekommen, hilft aber nichts.


Immer mit dem Fehler
"[dcc32 Fatal Error] System.Variants.pas(1271): E2158 System.Variants unit out of date or corrupted: missing '@VarCast'"
VarCast is declared as _VarCast, so in theory to make it work you need to strip all the functions in System.Variants.pas from these and adjust the whole unit to call them stripped code, though there might be something hidden to surprise you, which need to adjust system.pas itself, that most likely impossible with Delphi compiler.

If rebuilding the whole RTL (after making changes) is possible then that is the right way, in my opinion.
In case you succeeded in rebuilding the RTL, then i suggest to add global hooks with minimum interaction with the current code and declarations, these hooks and callback can be used for logging, and the RTL might still be compatible with default RTL, just food for thought.
Yes, I had seen the C-like notations, but that made me stop there.
To make such huge RTL change is not worth it, especially because I found the root cause meanwhile also without logging into this.

Thanks anyway, for the help here.
  Mit Zitat antworten Zitat
Kas Ob.

Registriert seit: 3. Sep 2023
386 Beiträge
 
#8

AW: Lokale Kopie von System.Variants.pas einbinden und nutzen, geht das?

  Alt 24. Nov 2023, 19:25
Yes, I had seen the C-like notations, but that made me stop there.
To make such huge RTL change is not worth it, especially because I found the root cause meanwhile also without logging into this.

Thanks anyway, for the help here.
I was referring to recompiling the shipped DCU's hence the RTL, from https://stackoverflow.com/questions/...sible-then-how
Code:
This is a very old question/answer, but I can confirm that this is still a working solution in Delphi 10.3. Thanks – 
Johann Burgess
 Mar 30, 2021 at 3:39
Kas
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:55 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 by Thomas Breitkreuz