Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use dll's
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00418635
Message ID:
00419214
Vues:
39
>>>
>>>OK, where'd Craig go? I'm gonna follow him running away screaming! < bg >
>>
>>Matt,
>>
>>Take my advice, ignore him. He loves this kind of attention. Next thing you know, he'll be talking about ether and other chemicals. Me? I blame Ed. He called him out.
>
>Be careful George, remember, in the first year of the UT awards, I got the longest mnemonic. You keep making me laugh like that and I might need to invent a new one that might be < gasp! > vulgar! lol

In that case, Matt, here's something we use around here just for that. Using this, you can be as vulgar as you 0x64616D6E well like:
DEFINE CLASS HexWords AS CUSTOM

  FUNCTION WordToHex
  
    LPARAMETER tcWord
    
    LOCAL lni, lnlast, lcresult, lcchar, lnchar
    lcresult = ""
    lnlast = LEN(tcWord)
    FOR lni = 1 TO lnlast
      lcchar = SUBSTR(tcWord, lni, 1)
      lcresult = lcresult + RIGHT(TRANSFORM(ASC(lcchar), "@0"), 2)
    NEXT
    lcresult = "0x" + lcresult
    RETURN lcresult
  ENDFUNC
  
  FUNCTION HexToWord
    
    LPARAMETER tcHex
    
    LOCAL lni, lnlast, lcresult, lcHex, lnchar
    lcresult = ""
    lcHex = SUBSTR(tcHex, 3)
    lnlast = LEN(lcHex)
    FOR lni = 1 TO lnlast STEP 2
      lnchar = EVALUATE('0x' + SUBSTR(lcHex, lni, 2))
      lcresult = lcresult + CHR(lnchar)
    NEXT
    RETURN lcresult
  ENDFUNC
ENDDEFINE
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform