Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SHFileOperation
Message
 
To
17/09/2002 13:58:36
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00701236
Message ID:
00701422
Views:
16
>George, I don't know how to convert the string returned to type that you specified, please help me...
>If is necessary, here is the code of my function...

I know Ed Rauh's stuff pretty well. There should be a function included with his CLSHEAP called DWORDTONUM() or something similar that accepts a string representation of a DWORD and converts it to an integer. If you can't find it, you can using the following
FUNCTION StringToInteger
    
  LPARAMETERS pcstring, plsigned
    
  LOCAL lnresult, lnlast, lni, llsigned,;
    lnmsb, lnmax
  lnresult = 0
  lnlast = LEN(pcstring)
  * Return Signed Integer?
  IF PCOUNT() = 2
    llsigned = plsigned
  ELSE
    llsigned = .F.
  ENDIF
  FOR lni = 1 TO lnlast
    lnresult = lnresult + ASC(SUBSTR(pcstring, lni, 1)) * (256 ^ (lni - 1))
  NEXT
  IF llsigned
    lnmsb = (lnlast * 8) - 1
    IF BITTEST(lnresult, lnmsb)
      lnmax = (2 ^ (lnmsb + 1))
      lnresult = lnresult - lnmax
    ENDIF
  ENDIF
  RETURN lnresult
ENDFUNC
Simply pass it SUBSTR(< stringvar >, 19, 4)(Sergey was correct, BTW.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform