Simple way to calculate pixel width of a string?

BlitzMax Forums/BlitzMax Beginners Area/Simple way to calculate pixel width of a string?

for scale:

Graphics 640 , 480 , 0 , 0

Global text:String = "This is a test string"

Print TextWidth(text)

SetScale(2.5 , 2.0)

Print TextWidth(text)

Print scTextWidth(text)

Function scTextWidth:Int(text:String)
	Local xScale:Float
	Local yScale:Float
	GetScale(xScale , yScale)
	Return TextWidth(text)*xScale
End Function