Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - FAQ - Zum CC1-Forum - Zum CC-Pro-Forum

String in Integer Kategorie: Programmierung (von Gerhard - 8.08.2002 10:53)


//Wandelt String nach Integer (neagitve+positive Zahlen)
function GetVal( byte s[]) returns int
      {byte i;int zahl,f; zahl=0;f=1;
      if s[31]==0 return-1;//in s[31] steht Länge des Strings
      for i=0...s[31]
        {if (s[i]>=0x30 and s[i]<=0x39)
       {zahl=zahl*10;zahl=zahl+(s[i]-0x30);}
      else {if s[i]=='-' f=-1;}}
      return zahl*f;}


    Antwort schreiben


Antworten:

... und weiter ? (o.T) (von André H. - 8.08.2002 11:05)