|
-
check this out and help
I am making a comparaison between two cells in a form
why do I get an error if the first digit sBaseSalarylow is greater sBaseSalaryHigh
even when the value of the low is smaller than the high
example
50,000 Low
100,000 high
5>1
Can anyone help I do not have my reference book with me.
if sBaseSalarylow > sBaseSalaryHigh then
document.all("salaryl").style.color="red"
ErrorExit = True
else
document.all("salaryl").style.color="black"
end if
-
Re: check this out and help
Looks like your Base Salary variables are character strings since they have
the "s" prefix. Since they're seen as text, they're being compared by which
one comes first alphabetically. Since 5 comes after 1, the string "50,000"
is seen as greater. Use the CCur conversion function to change the salaries
to Currency (i.e., "CCur(sBaseSalarylow) > CCur(sBaseSalaryHigh)") and it
should work.
Hope that helps,
Carl
"JM Thomas" <sakpasse1@hotmail.com> wrote:
>
> I am making a comparaison between two cells in a form
>
>why do I get an error if the first digit sBaseSalarylow is greater sBaseSalaryHigh
>even when the value of the low is smaller than the high
>
>
>example
>
>50,000 Low
>100,000 high
>
>
>5>1
>Can anyone help I do not have my reference book with me.
>
>
>if sBaseSalarylow > sBaseSalaryHigh then
> document.all("salaryl").style.color="red"
>
>ErrorExit = True
>else
> document.all("salaryl").style.color="black"
>
>end if
>
-
Re: check this out and help
Thanks
It works
What Book would you recommend for VBScript I am still in a learning Stage.
"Carl Ray" <carlray@vbnexus.com> wrote:
>
>Looks like your Base Salary variables are character strings since they have
>the "s" prefix. Since they're seen as text, they're being compared by which
>one comes first alphabetically. Since 5 comes after 1, the string "50,000"
>is seen as greater. Use the CCur conversion function to change the salaries
>to Currency (i.e., "CCur(sBaseSalarylow) > CCur(sBaseSalaryHigh)") and it
>should work.
>
>Hope that helps,
>
>Carl
>
>"JM Thomas" <sakpasse1@hotmail.com> wrote:
>>
>> I am making a comparaison between two cells in a form
>>
>>why do I get an error if the first digit sBaseSalarylow is greater sBaseSalaryHigh
>>even when the value of the low is smaller than the high
>>
>>
>>example
>>
>>50,000 Low
>>100,000 high
>>
>>
>>5>1
>>Can anyone help I do not have my reference book with me.
>>
>>
>>if sBaseSalarylow > sBaseSalaryHigh then
>> document.all("salaryl").style.color="red"
>>
>>ErrorExit = True
>>else
>> document.all("salaryl").style.color="black"
>>
>>end if
>>
>
-
Re: check this out and help
There's actually several good ones out there. The one that a lot of people
seem to like is an O'Reilly book called "Learning VBScript" by Paul Lomax.
If you are just looking for a desktop reference, there's one by Wrox called
"VBScript Programmer's Reference".
Carl
carlray@vbnexus.com
"JM Thomas" <sakpasse1@yaoo.com> wrote:
>
>Thanks
>It works
>What Book would you recommend for VBScript I am still in a learning Stage.
>
>
>"Carl Ray" <carlray@vbnexus.com> wrote:
>>
>>Looks like your Base Salary variables are character strings since they
have
>>the "s" prefix. Since they're seen as text, they're being compared by
which
>>one comes first alphabetically. Since 5 comes after 1, the string "50,000"
>>is seen as greater. Use the CCur conversion function to change the salaries
>>to Currency (i.e., "CCur(sBaseSalarylow) > CCur(sBaseSalaryHigh)") and
it
>>should work.
>>
>>Hope that helps,
>>
>>Carl
>>
>>"JM Thomas" <sakpasse1@hotmail.com> wrote:
>>>
>>> I am making a comparaison between two cells in a form
>>>
>>>why do I get an error if the first digit sBaseSalarylow is greater sBaseSalaryHigh
>>>even when the value of the low is smaller than the high
>>>
>>>
>>>example
>>>
>>>50,000 Low
>>>100,000 high
>>>
>>>
>>>5>1
>>>Can anyone help I do not have my reference book with me.
>>>
>>>
>>>if sBaseSalarylow > sBaseSalaryHigh then
>>> document.all("salaryl").style.color="red"
>>>
>>>ErrorExit = True
>>>else
>>> document.all("salaryl").style.color="black"
>>>
>>>end if
>>>
>>
>
-
Re: check this out and help
JM: I see you've received answers to your questions, but for future
reference, you're more likely to get help with VBScript questions if you
post them to the web.dhtml.scripting newsgroup. As its name implies, this
group is for announcements, not technical discussions. Thanks!
---
Phil Weber
DevX Newsgroup Admin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks