W
WoDing
Unregistered / Unconfirmed
GUEST, unregistred user!
SQL自定义函数大致过程:<br> declare @WideStr Nchar(20) ,@SubStr NChar(1)<br> declare @ReturnStr Char(20)<br> declare @i int,@j int<br> Select @WideStr=Cast( '中华人民共和国' as NChar )<br> Select @j=Len(@WideStr)<br> SElect @i=1<br> SElect @ReturnStr=''<br> While @i< @j<br> begin <br> Select @SubStr=Substring(@WideStr,@i,1) <br> Select @ReturnStr=@ReturnStr+@SubStr //函数原来是select @ReturnStr=@ReturnStr+IsNull( FieldName,'') from TableName where Field=@SubStr <br> Select @i=@i+1<br> end<br>select @ReturnStr<br>为什么@ReturnStr的值是空字符串?<br><br>2 一段代码 在button的click中执行正常,在timer的Timer1Timer中执行结果是错误的<br>并且在Timer1Timer中直接调用button1.Click也是错误的<br><br> function EnumChildWindowsProc(hwnd: Integer; lparam: Longint):Boolean; stdcall;<br> var<br> buffer: array[0..255] of Char;<br> R: TRect;<br> s:string;<br> begin<br> Result := True;<br> GetWindowRect(hwnd, R);<br> SendMessage(hwnd, WM_GETTEXT, 1024, Integer(@buffer)); //Text<br> //GetClassName(hwnd,buffer,256);<br> s:= format('绝对:(%-5d,%-5d),相对:(%-5d,%-5d),标签:%-30s',<br> [R.Left,R.Top,R.Left-FWinRect.Left,R.Top-FWinRect.Top,StrPas(buffer)]);<br> form1.Memo1.Lines.Add( s);<br> <br> end;<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> Handle: Integer;<br>begin<br> Handle := FindWindow(nil,PChar(FWinTitle));<br> if not IsWindowVisible(Handle) then<br> exit;<br> memo1.Lines.Clear;<br> if Handle<>0 then<br> begin<br> GetWindowRect(Handle, FWinRect);//<br> EnumChildWindows(Handle,@EnumChildWindowsProc,Integer(@Handle));<br> end;<br> end;