Re: copymemory basic question



"Karl E. Peterson" <karl@xxxxxxxx> schrieb im Newsbeitrag
news:eKBenSlrFHA.3640@xxxxxxxxxxxxxxxxxxxxxxx
> Private Sub SwapPtrs(s1 As String, s2 As String)
> Static lpTmp As Long
> lpTmp = StrPtr(s1)
> Call CopyMemory(ByVal VarPtr(s1), ByVal VarPtr(s2), 4&)
> Call CopyMemory(ByVal VarPtr(s2), lpTmp, 4&)
> End Sub
>

Why Static?

Don

.



Relevant Pages

  • Re: copymemory basic question
    ... Public Sub SwapStr01(s1 As String, ... Static lpTmp As Long ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... > Public Sub SwapStr01(s1 As String, ... > Static lpTmp As Long ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... Private Sub SwapPtrs1(s1 As String, ... Static lpTmp As Long ... > I am sorting string arrays this way myself. ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... >>> Private Sub SwapPtrs(s1 As String, ... >>> Static lpTmp As Long ... > function with no local variables can have a smaller prolog, ...
    (microsoft.public.vb.winapi)
  • Re: copymemory basic question
    ... >> Private Sub SwapPtrs(s1 As String, ... >> Static lpTmp As Long ... Static locals are the way to avoid stack variables and still remain structured. ...
    (microsoft.public.vb.winapi)

Loading