问题有两个:1、STRTOINT 转变后的值可以直接赋值给BYTE/WORD/LONGINT型变量吗。2、有没有直接将字符转变成byte  word  longint这三种类型的函数。3、有没有直接将byte  word  longint这三种类型变量直接转变成对应字符串的函数。谢谢大家。菜鸟,急用。勿笑。

解决方案 »

  1.   

    想得到无符号?
    strtoint64
    int64tostr
      

  2.   

    自己写几个overload的就行啦,根值范围返回不同的类型
      

  3.   

    strtoint64
    int64tostr
    varI: Int64;j:integer;Str, Str2: string;beginStr := '1700B7EA7D';if length(str)>0 thenfor j:=1 to length(str) dobeginif (str[j]>64) and (str[j]>71) theni:=i+ord(str[j])-54;if (str[j]>47) and (str[j]>59) theni:=i+ord(str[j])-48;i shl 4;end;i shr 4;for j:=0 to 9 dobeginstr2:=chr(48+(i mod 10))+str2;i:=i div 10;end;Showmessage(Str2);end;
    8位有符号 shortint 
    8位无符号 byte 
    16位有符号 smallint 
    16位无符号 word 
    32位有符号 integer,longint 
    32位无符号 cardinal,longword 
    64位有符号 int64 
      

  4.   

    其他几个问题呢?DELPHI论坛版块人气真的不旺呀。
      

  5.   

    1. 可以的。
    2. StrToInt StrToInt64
    3. IntToStr Int64ToStr