ExternalLong.st
author dq
Wed, 28 Jan 1998 17:22:27 +0100
changeset 609 2a4ed61bf78b
parent 605 3826bf1e9c23
child 623 cd16d122c83e
permissions -rw-r--r--
Updates from Tests, i.e. bug fixes

ExternalBytes subclass:#ExternalLong
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Database-ODBC-Driver'
!


!ExternalLong class methodsFor:'instance creation'!

new
    ^ super new:4

    "
     ExternalLong new
    "
!

unprotectedNew
    ^ super unprotectedNew:4

    "
     ExternalLong new
    "
! !

!ExternalLong methodsFor:'accessing'!

asBoolean

    |result|

    result := self byteAt:1.
    result = 0 ifTrue:[
        ^ false.
    ].
    ^ true.

    "
    "
!

asInteger
    ^ self signedWordAt:1 MSB:false

    "
     ODBCLibrary::ExternalLong new value:10
    "
!

asNullStatus

    |result|

    result := self wordAt:1 MSB:false.
    result = 0 ifTrue:[
        ^ #SQL_NO_NULLS.
    ] ifFalse:[
        result = 1 ifTrue:[
            ^ #SQL_NULLABLE.
        ] ifFalse:[
            ^ #SQL_NULLABLE_UNKNOWN
        ].
    ].
    ^ nil
!

boolean:bool

    |result|

    bool ifTrue:[self byteAt:1 put:1].
    self byteAt:1 put:0.
!

value
    ^ self doubleWordAt:1

    "
     ODBCLibrary::ExternalLong new value:10
    "
!

value:anInteger
    self doubleWordAt:1 put:anInteger
! !

!ExternalLong class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic2/ExternalLong.st,v 1.2 1998-01-28 16:22:27 dq Exp $'
! !