On Mon, Jul 21, 2008 at 7:50 PM, MB Software Solutions General Account <[EMAIL PROTECTED]> wrote: > Stephen Russell wrote: >>>> You could keep it as char() and have him do the conversion on his >>>> side. You indexs should work for finding. He/she can do the >>>> conversion from their side as needed. >>>> >>>> >>>> >>> Steve, an Integer field stores values from -2,xxx,yyy,zzz to >>> 2,xxx,yyy,zzz so how would leaving it as a 8 byte char() work better? >>> That's one digit less, if I understand you correctly. ??? >>> >>> Are you trying to multi-thread again? <g> >> >> I thought that I was saying you could do the storage in char() and >> have them do the conversion on their side for the data.Type() they >> want to use. All you are presenting is storage. > > Then how do you represent 2,123,456,789 in a char(8) field using your idea?
Easy: 2,123,456,789 in hex is: 7E, 91, 61, 15 Convert these bytes back to decimal: 126, 145, 97, 21 So to store this number in 8 characters you would use: Chr(0) + Chr(0) + Chr(0) + Chr(0) + Chr(126) + Chr(145) + Chr(97) + Chr(21) (this assumes big-endian 'most significant byte first' format...) Which should work, but I don't know if fox will mess up the character codes... BINTOC(2123456789,"S") almost does what you want but only returns 4 bytes (unless it's a float) n = 2123456789 a=BINTOC(n,"S") FOR x=1 TO LEN(a) ??ASC(SUBSTR(a,x,1)) ENDFOR = 126, 145, 97, 21 You probably don't want to work with big-endian format if you're talking to other systems as Intel chips use little-endian. Let me know if you need any help! -- Paul _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.