Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ncar!gatech!psuvax1!psuvm!f0o From: F0O@psuvm.psu.edu Newsgroups: comp.sys.ibm.pc.misc Subject: Need algorithm(s) to convert numbers to proper datatypes Message-ID: <90346.135217F0O@psuvm.psu.edu> Date: 12 Dec 90 18:52:17 GMT Organization: Penn State University Lines: 30 I'm using QuickBasic 4.5, and I need to know the algorithm that converts a number like 123.456 into it's byte(s) representation. I need to know this to convert single, long or integer numbers. With QuickBasic, you can use the VARSEG and VARPTR functions to get the address of a variable, but QuickBasic doesn't provide the reverse function, given the address of a variable. I know you can simply pass the variable name and not have to worry about pointers, but for my application that won't work. I need to do this in QuickBasic; no calling a C or assembler routine. :-( What I can't do: CALL AssignValue(Value) Print Value ... SUB AssignValue(Value) Value = 123.456 or whatever END SUB What I want to do: Call AssignValue(Varseg(Value), VarPtr(Value)) print Value ... SUB AssignValue(Segment as integer, Offset as integer) put 123.456 into memory locations starting at Segment:Offset END SUB Any help would be greatly appreciated! [Tim]