ExternalLong.st
author Claus Gittinger <cg@exept.de>
Mon, 30 Mar 1998 17:09:07 +0200
changeset 623 cd16d122c83e
parent 609 2a4ed61bf78b
child 1926 b7740748e15c
permissions -rw-r--r--
category change

ExternalBytes subclass:#ExternalLong
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'System-Support'
!


!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

    "
     ExternalLong new value:10
    "

    "Modified: / 30.3.1998 / 17:07:57 / cg"
!

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

!ExternalLong class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic2/ExternalLong.st,v 1.3 1998-03-30 15:09:07 cg Exp $'
! !