当前位置:首页
开发技术指南» 文章正文
    引言:

    摘要: 我在主程序中使用了库中函数: int retcode=tsfid_connect(&cport,&cbaud); 库中声明如下: int dll_exp _stdcall tsfid_connect(int *commport,dword *curbaud); 运行主程序出现: [linker error] unresolved external __stdcall tsf......
    摘要: 我想获得当前窗体下面一层的那个窗体(另外的程序)的标题,我的代码如下: procedure tform1.button3click(sender: tobject); var pstr:pchar; hwndcruuent:integer; begin getmem(pstr,255); hwndcurrent:=getwindow(form1.handle,gw_hwndnext); g......


字符串

字符串与字符串怎么样比较?例如3>=   怎么样比较的?会有什么结果?

NO.1   作者: laishoulin

就是ascii值诸位比较!

NO.2   作者: laishoulin

打错了,从第一位开始‘逐位’比较  
  例如a<b是true  
  c<b是false  
  abc<abd呢?true

NO.3   作者: chll

同意李大嘴的

NO.4   作者: SayForever

空格的ASCII码为90,3的ASCII为53   所以3>=   ,为False;

NO.5   作者: laishoulin

这个是pascal幕后操作和实现的:  
  从第一位开始‘逐位’比较,找到可以比较出的大小的位就返回。  
  例如a<b是true  
  c<b是false  
  abc<abd呢?true,因为前两位相同,第三位c<d  
  那么acd<abd呢?a=a继续c<b判断出来了c<b是false返回false!  
 

NO.6   作者: yangguo_god

你的3>=  
  不是空格,而是空吧

NO.7   作者: xywu

直接比较就可以了,Delphi默认

NO.8   作者: Jerry529

uses   SysUtils;  
  procedure   TForm1.Button1Click(Sender:   TObject);  
   
  var  
      Msg:   string;  
      CompResult:   Integer;  
  begin  
      Msg   :=   Edit1.Text;  
      CompResult   :=   StrComp(PChar(Edit1.Text),   PChar(Edit2.Text));  
      if   CompResult   <   0   then  
          Msg   :=   Msg   +     is   less   than    
      else   if   CompResult   >   0   then  
          Msg   :=   Msg   +     is   greater   than    
      else  
          Msg   :=   Msg   +     is   equal   to    
      Msg   :=   Msg   +   Edit2.Text;  
      ShowMessage(Msg);  
  end;


    摘要: 如何以打开页面就是chormless窗口,而不是弹出的? 或者说,用弹出窗口如何关闭原始的窗口,谢谢 ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE