Jump to content
Fivewin Brasil

converter Caracter ("3") para Byte


gibaf

Recommended Posts

Não sei se ja conhece mas se quiser mais detalhes 

http://wiki.fivetechsoft.com/doku.php?id=fivewin_functions_by_category

Numeric manipulation

Atang() Calculates the angle whose tangent is a specified number
B2Bin() Converts a byte into a string 1 byte len
Bin2d() Converts a string into a 4 byte double precision numeric
C2Hex() Converts a byte into a hex string (2 chars)
Cos() Calculates the cosine function of an angle
cStrWord() To extract a word of a string of characters
D2bin() Converts a floating point number into a string
Dectohex() Converts a number in its hexadecimal form
Hex2str() Converts a hexadecimal representation of a string in its corresponding
Hextodec() It converts a chain hexadecimal to a decimal number
Htons() Convert a u_short from host to network byte order
I2hex() Converts a word (2 bytes) into a hex string (4 chars)
L2hex() Converts a long (4 bytes) into a hex string (8 chars)
Land() Retrieves the logical AND of some numeric values
Lxor() Exclusive Or Nand() Generates a numeric AND value from some numbers
Ndbl2flt() Convert a Double to Float
Nhex() To convert a hexadecimal to decimal
Nhibyte() Returns the High Byte of a word (two bytes)
Nhiword() Returns the HiWord of a long (four bytes)
Nlobyte() Returns the Low byte of a word (two bytes)
Nloword() Returns the Low word of a long (four bytes)
Nmakelong() Generates a long (4bytes) from two words (2bytes)
Nnot() This function carries out a logical NOT to an operator
Nor() Generates a numeric OR value from some numbers
Nrandom() Generates a random number
Ntobin() 1 and .f. for 0)
Nxor() An exclusive Or executes with a list of parameters
Sin() Calculates the sine function of an angle
Str2hex() Converts the characters of a string in their hexadecimal representation
Strbyte() Assign/obtain the value of a byte
Tang() Calculates the tangent function of an angle
UtoS() Converts a long value to short
 
Link to comment
Share on other sites

Não sei se ja conhece mas se quiser mais detalhes 

http://wiki.fivetechsoft.com/doku.php?id=fivewin_functions_by_category

Numeric manipulation

Atang() Calculates the angle whose tangent is a specified number
B2Bin() Converts a byte into a string 1 byte len
Bin2d() Converts a string into a 4 byte double precision numeric
C2Hex() Converts a byte into a hex string (2 chars)
Cos() Calculates the cosine function of an angle
cStrWord() To extract a word of a string of characters
D2bin() Converts a floating point number into a string
Dectohex() Converts a number in its hexadecimal form
Hex2str() Converts a hexadecimal representation of a string in its corresponding
Hextodec() It converts a chain hexadecimal to a decimal number
Htons() Convert a u_short from host to network byte order
I2hex() Converts a word (2 bytes) into a hex string (4 chars)
L2hex() Converts a long (4 bytes) into a hex string (8 chars)
Land() Retrieves the logical AND of some numeric values
Lxor() Exclusive Or Nand() Generates a numeric AND value from some numbers
Ndbl2flt() Convert a Double to Float
Nhex() To convert a hexadecimal to decimal
Nhibyte() Returns the High Byte of a word (two bytes)
Nhiword() Returns the HiWord of a long (four bytes)
Nlobyte() Returns the Low byte of a word (two bytes)
Nloword() Returns the Low word of a long (four bytes)
Nmakelong() Generates a long (4bytes) from two words (2bytes)
Nnot() This function carries out a logical NOT to an operator
Nor() Generates a numeric OR value from some numbers
Nrandom() Generates a random number
Ntobin() 1 and .f. for 0)
Nxor() An exclusive Or executes with a list of parameters
Sin() Calculates the sine function of an angle
Str2hex() Converts the characters of a string in their hexadecimal representation
Strbyte() Assign/obtain the value of a byte
Tang() Calculates the tangent function of an angle
UtoS() Converts a long value to short

 

e, qual devo usar (hehehe) ???

Link to comment
Share on other sites

//------------------------------------------------------------------------//

function nToBin( nNumber )

   local aBin := Array( 32 )
   local nFor

   FOR nFor := 1 TO 32
      aBin[ nFor ] = lAnd( nNumber, 2 ** ( nFor - 1 ) )
   NEXT

return aBin

//------------------------------------------------------------------------//

function BinToN( aBin )

   local nFor, nNumber

   nNumber := 0

   FOR nFor := 1 TO 32
      nNumber += If( aBin[ nFor ], 2 ** ( nFor - 1 ), 0 )
   NEXT

return Int( nNumber )

//------------------------------------------------------------------------//

function BinToC( aBin, lSep )

   local cBin
   local nFor

   DEFAULT lSep := .t.

   cBin := ""

   FOR nFor := 32 TO 1 STEP -1
      cBin += If( aBin[ nFor ], "1", "0" )
      if lSep .and. Empty( ( nFor - 1 ) % 4 )
         cBin += " "
      endif
   NEXT

return cBin

//------------------------------------------------------------------------//

 

c:\"SeuFivewin"\Source\function\math.prg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...