Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Stringoperationen (Rapidshare API) (https://www.delphipraxis.net/156979-stringoperationen-rapidshare-api.html)

veX 23. Dez 2010 02:37

Delphi-Version: 2010

Stringoperationen (Rapidshare API)
 
Nacht jungs und mädels,

also folgendes, ich bekomm von der RS Api z.B. ein solchen String zurück:

Code:
119927301,urlaubsbilder.rar,104857600,213,1,tl,0
Kurze Erklärung:

119927301 = file id
urlaubsbilder.rar = file name
104857600 = file size in bytes
213 = server id
1 = file status
tl = shorthost
0 = md5 (wenn gewollt ansonsten immer 0)

Mir sind nur 2 teilstrings wichtig, und zwar brauch ich einmal den file status und die file size. Der Status ändert sich von fall zu fall (0 = file not found, 1 = file ok, 2 = server down usw.) Ich bräuchte also 2 funktionen, die mir die beiden teilstrings in 2 variablen ausschneidet/kopiert.
Ich hab dann ein wenig rumgetestet mit pos, ReverseString usw usf...und hab das nich wirklich lösen können. Das Problem ist, dass der shorthost mal 2 zeichen hat, mal 3 und ob die server id immer 3 zeichen hat weiß ich nicht.

Wenn mir also einer von euch helfen könnte, wäre das natürlich klasse. Ich mach jetzt erstmal Schluss, um die Uhrzeit wirds eh nix mehr bei mir und ich und stringoperationen naja :)

gruß

Der.Kaktus 23. Dez 2010 05:08

AW: Stringoperationen (Rapidshare API)
 
Hallo,

schau Dir mal die Funktionen aus der RX-Lib bzw. JvStrUtils an. Sollte genau das sein was Du suchst.

Delphi-Quellcode:
function WordCount(const S: string; const WordDelims: TCharSet): Integer;
{ WordCount given a set of word delimiters, returns number of words in S. }
function ExtractWord(N: Integer; const S: string;
  const WordDelims: TCharSet): string;

mkinzler 23. Dez 2010 05:23

AW: Stringoperationen (Rapidshare API)
 
Oder mit Explode()Explode() oder einer StringListe

veX 23. Dez 2010 19:17

AW: Stringoperationen (Rapidshare API)
 
danke jungs habs hinbekommen ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:28 Uhr.

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