Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MKD$ CVD on LB (MBF Mode)

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> LB for MS-DOS BASIC Users
View previous topic :: View next topic  
Author Message
Petrus
Junior Member


Joined: 12 Jul 2014
Posts: 13
Location: Barcelona - Spain

PostPosted: Aug 29th, 2014, 11:45am    Post subject: MKD$ CVD on LB (MBF Mode) Reply with quote

Hi,

Im Pedro from Spain, and I have a question..., please.

I have some databases created with QuickBasic in MBF mode, incorporating numerical data loaded by MKD$ instruction, which need an instruction CVD to be read.
I found the following functions on the web, but not right for databases in MBF mode created.
Could you send me an instruction CVD to work properly with MBF databases.

Thanks in advance.


'Function CVD( EightBytes$ )
'If Len(EightBytes$) = 8 Then
'B1 = Asc(Mid$(EightBytes$, 8, 1))
'B2 = Asc(Mid$(EightBytes$, 7, 1))
'B3 = Asc(Mid$(EightBytes$, 6, 1))
'B4 = Asc(Mid$(EightBytes$, 5, 1))
'B5 = Asc(Mid$(EightBytes$, 4, 1))
'B6 = Asc(Mid$(EightBytes$, 3, 1))
'B7 = Asc(Mid$(EightBytes$, 2, 1))
'B8 = Asc(Mid$(EightBytes$, 1, 1))
'S = (B1 And 128) / 128 'Sign bit
'E = (B1 And 127) * 16 + (B2 And 240) / 16 'Exponent
'X = B8 + B7 * HexDec("100") + B6 * HexDec("10000") + _
'B5 * HexDec("1000000") + B4 * HexDec("100000000") + _
'B3 * HexDec("10000000000") + (B2 And 15) * 2 *_
'HexDec("1000000000000")
'F = 0.0
'For N = 1 To 52
'If X And 2 ^ N Then F = F + 2 ^ (N - 53)
'Next
'Select Case E
'Case 2047
'CVD = 0.0
'If F = 0 Then 'Infinity
'If S = 0 Then Err$(0) = "INF" _
'Else Err$(0) = "-INF"
'Else
'Err$(0) = "NaN" 'Not a Number
'End If
'Case 0
'If F = 0 Then
'CVD = 0.0
'Err$(0) = "OK"
'Else 'Unnormalized value
'CVD = -1 ^ S * 2 ^ -1022 * F
'Err$(0) = "OK"
'End If
'Case Else
'CVD = -1 ^ S * 2 ^ (E - 1023) * (1 + F)
'Err$(0) = "OK"
'End Select
'Else
'CVD = 0.0
'Err$(0) = "PARAM"
'End If
'End Function
Back to top
View user's profile Send private message Send e-mail
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 728

PostPosted: Aug 29th, 2014, 3:22pm    Post subject: Re: MKD$ CVD on LB (MBF Mode) Reply with quote

Hello Pedro,

I think you need to take a look at the QB64 language (www.qb64.net). It claims complete compatibility with QB/QBasic and has functions named CVSMBF, CVDMBF, MKSMBF$, and MKDMBF$, that look like what you need.

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Petrus
Junior Member


Joined: 12 Jul 2014
Posts: 13
Location: Barcelona - Spain

PostPosted: Aug 29th, 2014, 3:51pm    Post subject: Re: MKD$ CVD on LB (MBF Mode) Reply with quote

ok, perfect !!
Thank You Very Much.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> LB for MS-DOS BASIC Users All times are GMT
Page 1 of 1
Jump to:  
Quick Reply
Username:
Message:
   Shortcut keys: Alt+Q to activate, Alt+P to preview, Alt+S to submit
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group