[futurebasic] Re: UNS$ problem

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1998 : Group Archive : Group : All Groups

From: Mars Saxman <marssaxman@...>
Date: Wed, 3 Jun 98 16:29:28 -0800
>I'm trying to find how to use something like UNS$
>in a mini-runtime app.
>
>I need values ranging from 0 to 65535 instead of
>-32768 to 32767.

Here's an implementation of Uns$ used in another dialect of BASIC. It 
shouldn't be too hard to tweak the syntax to get it to run in FB.

-Mars

Const _asciiZero = #"0"

Public Function Uns$(value As Uns Long Integer) As String * 10
	Dim outText$ As String * 10
	outText$ = Chr$((value Mod 10) + _asciiZero)
	Do While value > 9
		value = value / 10
		outText$ = Chr$((value Mod 10) + _asciiZero) + outText$
	Loop
End Function = outText$