[jawsscripts] Re: padding integers

HI Sean,

You are not missing any operators. The "plus sign" is the catonation 
operator.

The problem is that JAWS scripting language will add two totally numeric 
strings instead of catonating them.The solution is as follows:
; x and y are two strings that contain digits only.

Let sResult = "@" + x + y
Let sResult = StringChopLeft (sResult, 1)
; sResult will now contain the catonated string of x then y.

HTH
Regards,
James

jimpanes@xxxxxxxxx
jimpanes@xxxxxxxxxxxx
"Everything is easy when you know how."

----- Original Message ----- 
From: "Sean Randall" <seanr@xxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Saturday, February 21, 2009 1:58 PM
Subject: [jawsscripts] padding integers


Hi all,

Can anybody shed any light on a problem I am having?

 I want to get a string from an integer, but pad it with a leading 0.
therefore, when a script has:
sayString("0"+intToString(3))
I expect to hear "03".

The only solution I've found is to do something along the lines of:
Let x = "0 "+intToString(3)
Let x = stringReplaceSubstrings(x," ","")

Seems remarkably cludgy to me.  Am I missing a concatenation operator?

Any takers?
Sean.
"Everything is funny as long as it is happening to Somebody Else." Will
Rogers

__________
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: