4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Double IEEE in Basic
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Sat Sep 25, 2004 9:00 pm (19 years, 6 months ago) Reply with QuoteBack to Top

Hi,

I've writen a program in qbasic to perform a specific task. Now, the problem is that the variable v (v1,v2,v3)must be not a single double ( 4 bytes ) but an IEEE double ( 8 bytes ) - the following programs force me to have the values in this format.
The code I've written is as follows:

CLS
DIM v AS DOUBLE
n = 0
ON ERROR GOTO 1000
OPEN "c:\jpl408\jpleph.408" FOR INPUT AS #1
OPEN "c:\jpl408\408.txt" FOR BINARY AS #2
r=SEEK (2)
DO UNTIL EOF(1)
LINE INPUT #1, a$
a$ = LTRIM$(a$)
v1 = 0: v2 = 0: v3 = 0
i = INSTR(1, a$, " ")
v1 = VAL(MID$(a$, 1, i - 1))
a$ = LTRIM$(MID$(a$, i + 1)): i = INSTR(1, a$, " ")
v2 = VAL(MID$(a$, 1, i - 1))
a$ = LTRIM$(MID$(a$, i + 1))
v3 = VAL(MID$(a$, 1))
i = INSTR(1, a$, "D")
IF i >= 1 THEN PUT #2, , v1
IF i >= 1 THEN PUT #2, , v2
IF i >= 1 THEN PUT #2, , v3: n = n + 1: LOCATE 1, 1: PRINT n
LOOP
CLOSE
END
1000 i = 0: RESUME NEXT



I think that this must be programed in Visual Basic. Another problem, is that the results overwriten the existing data in 408.txt

Can someone help me making the necessary changes? As always this is very urgent.

Regards,

Kepler
OfflineView User's ProfileFind all posts by keplerSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Sat Sep 25, 2004 10:29 pm (19 years, 6 months ago) Reply with QuoteBack to Top

Wow, this is kind of out of the scope of web development. You might have more luck with this one on a programming forum Smile

Also, moved to Chit Chat.

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot 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.


Page generation time: 0.322357 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme