Files
harbour-core/harbour/contrib/hbnf/dectobin.prg
Viktor Szakats 6d60145620 2012-11-07 03:28 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/hbnf.hbx
  * contrib/hbodbc/hbodbc.hbx
  * contrib/hbtip/hbtip.hbx
  * contrib/hbtpathy/hbtpathy.hbx
  * contrib/xhb/xhb.hbx
    ! minor fixes

  * contrib/hblzf/tests/*.prg
  * contrib/hbmxml/format.prg
  * contrib/hbmysql/tests/test.prg
  * contrib/hbmysql/tmysql.prg
  * contrib/hbmysql/tsqlbrw.prg
  * contrib/hbnetio/netiomt.prg
  * contrib/hbnetio/utils/hbnetio/*.prg
  * contrib/hbnf/*.prg
  * contrib/hbnf/tests/*.prg
  * contrib/hbodbc/tests/testodbc.prg
  * contrib/hbodbc/todbc.prg
  * contrib/hbpgsql/tests/*.prg
  * contrib/hbpgsql/tpostgre.prg
  * contrib/hbssl/tests/*.prg
  * contrib/hbtip/*.prg
  * contrib/hbtip/tests/*.prg
  * contrib/hbtpathy/telepath.prg
  * contrib/hbzebra/tests/*.prg
  * contrib/rddads/tests/*.prg
  * contrib/xhb/*.prg
  * contrib/xhb/tests/*.prg
    * formatted
    ! commented code converted to #if 0/#endif block
2012-11-07 02:57:26 +00:00

41 lines
835 B
Plaintext

/*
* $Id$
*/
/*
* Author....: Greg Lief
* CIS ID....: 72460,1760
*
* This function is an original work by Mr. Grump and is placed in the
* public domain.
*
* Modification history:
* ---------------------
*
* Rev 1.2 15 Aug 1991 23:03:22 GLENN
* Forest Belt proofread/edited/cleaned up doc
*
* Rev 1.1 14 Jun 1991 19:51:30 GLENN
* Minor edit to file header
*
* Rev 1.0 01 Apr 1991 01:01:06 GLENN
* Nanforum Toolkit
*
*/
FUNCTION ft_Dec2Bin( x )
LOCAL buffer := { "0", "0", "0", "0", "0", "0", "0", "0" }
LOCAL i
FOR i := 8 TO 1 STEP -1
IF x >= 2 ^ ( i - 1 )
x -= 2 ^ ( i - 1 )
buffer[ 9 - i ] := "1"
ENDIF
NEXT
RETURN ;
buffer[ 1 ] + buffer[ 2 ] + buffer[ 3 ] + buffer[ 4 ] + ;
buffer[ 5 ] + buffer[ 6 ] + buffer[ 7 ] + buffer[ 8 ]