Delphi-PRAXiS
Seite 1 von 5  1 23     Letzte » 

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   ANSISTRING unter Linux verfügbar ??? (https://www.delphipraxis.net/196723-ansistring-unter-linux-verfuegbar.html)

bernhard_LA 12. Jun 2018 19:39

Delphi-Version: 5

ANSISTRING unter Linux verfügbar ???
 
wir verwenden in einer Unit den Datentyp ANSISTRING,
die Unit System ist eingebunden, allerdings will der compiler ANSISTRING nicht finden.... was mache ich falsch ?

jaenicke 12. Jun 2018 19:50

AW: ANSISTRING unter Linux verfügbar ???
 
AnsiString gibt es dort nicht, nein. Was es soweit ich mich erinnere gibt ist RawByteString.

Bist du sicher, dass du dort so etwas brauchst?

mkinzler 13. Jun 2018 07:59

AW: ANSISTRING unter Linux verfügbar ???
 
https://community.embarcadero.com/es...gs-for-nextgen

Fritzew 13. Jun 2018 08:12

AW: ANSISTRING unter Linux verfügbar ???
 
Was geht ist:

Delphi-Quellcode:
Var UniString : String;
    U8String : UTF8String;
    Raw : RawByteString;

himitsu 13. Jun 2018 09:26

AW: ANSISTRING unter Linux verfügbar ???
 
RawByteString und UTF8String sind doch auch AnsiStrings. :gruebel:
Gingen im NextGen eigentlich die ShortStrings auch nicht? (
Delphi-Quellcode:
ShortString
und
Delphi-Quellcode:
String[123]
)

Was aber immer gehen sollte, ist TEncoding und als TBytes (darin die Chars des ANSI)

KodeZwerg 13. Jun 2018 10:53

AW: ANSISTRING unter Linux verfügbar ???
 
Key Traits of the Coming Delphi For Linux Compiler
Zitat:

It is true, however, that some other string types like AnsiString are not supported. This is mostly a "Windows-centric" data type. If you are still using strings and PChar for managing generic data structures, it is really time to move to TBytes and PByte instead -- or enable pointer math for all data structures. Also the support for the old Pascal ShortString type is limited. Declaring a string [20] variable on Linux will fail. The other string type that is not supported is WideString. This is the old pre-Unicode non-reference counted UTF-16 type used for Windows COM platform integration. In fact, any COM-specific type and feature is missing on Linux, like on all other non-Windows Delphi platforms.

Notice that the TEncoding support is available, so you can read and write text files in any format you want. What you are not directly able to do is process an AnsiString in memory with the standard language support. But you can have an array of bytes (TBytes) representing text in any format in memory, and read and write it on disk, or receive and send via a socket connection, and you ca use the TEncoding support for conversions.
himitsu hat mal wieder voll ins schwarze getroffen:thumb:

bernhard_LA 13. Jun 2018 22:47

AW: ANSISTRING unter Linux verfügbar ???
 
Delphi-Quellcode:
type AnsiStringCrossPlatform = {$ifdef MSWINDOWS} ANsistring {$endif } {$ifdef LINUC} RawByteString {$endif }

also muss ich sowas kodiere, gibt's was besseres ?

KodeZwerg 13. Jun 2018 23:03

AW: ANSISTRING unter Linux verfügbar ???
 
Zitat:

Zitat von jaenicke (Beitrag 1404667)
Bist du sicher, dass du dort so etwas brauchst?

Das würde mich auch interessieren wofür man Windows String-Typen unter non-Windows benötigt.

Uwe Raabe 13. Jun 2018 23:28

AW: ANSISTRING unter Linux verfügbar ???
 
Zitat:

Zitat von KodeZwerg (Beitrag 1404775)
Zitat:

Zitat von jaenicke (Beitrag 1404667)
Bist du sicher, dass du dort so etwas brauchst?

Das würde mich auch interessieren wofür man Windows String-Typen unter non-Windows benötigt.

Auf die Frage haben wir ja bisher noch keine Antwort. Davon hängt allerdings entscheidend ab, welche Lösung man hier vorschlagen kann.

Dennis07 13. Jun 2018 23:31

AW: ANSISTRING unter Linux verfügbar ???
 
Zitat:

Zitat von bernhard_LA (Beitrag 1404774)
Delphi-Quellcode:
type AnsiStringCrossPlatform = {$ifdef MSWINDOWS} ANsistring {$endif } {$ifdef LINUC} RawByteString {$endif }

also muss ich sowas kodiere, gibt's was besseres ?

Kannst du so machen, wäre aber unsinnig.
1. gibt es RawByteString auch unter Windows und
2. ist RawByteString = PChar und
3. musst du diese deswegen stets unterschiedlich behandeln

Somit würde dir so etwas nichts an Aufwand einsparen, sondern deinen Code nur länger und unübersichtlicher machen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:38 Uhr.
Seite 1 von 5  1 23     Letzte » 

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz