Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Return value Red if negative (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: Update editField in a paint event
Next thread: Re[2]: Where you from ?


RB Database   -   tom.russell transport.alstom.com
  Return value Red if negative   -   Lennox Jacob
   Re: Return value Red if negative   -   Aaron Ballman
    Re: Return value Red if negative   -   Lennox Jacob
     Re: Return value Red if negative   -   Aaron Ballman
     Re: Return value Red if negative   -   Terry Ford
      Re: Return value Red if negative   -   Lennox Jacob
    Re: Return value Red if negative   -   Lennox Jacob
     Re: Return value Red if negative   -   Aaron Ballman
      Re: Return value Red if negative   -   Lennox Jacob

Return value Red if negative
Date: 01.02.05 00:21 (Mon, 31 Jan 2005 23:21:05 +0000)
From: Lennox Jacob
If I have a line lke this:
CanLose.text = format(R2, "#.##")
that will return a value in CanLose EditField.
Now I want that value to be red if it is negative, normally it is black.
So I now have :
CanLose.text = format(R2, "#.##")
if CanLose.Text < 0 then
what
Please help.
Thanks.
Lennox.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Return value Red if negative
Date: 01.02.05 00:24 (Mon, 31 Jan 2005 17:24:59 -0600)
From: Aaron Ballman
> if CanLose.Text < 0 then

if Val( VanLose.Text ) < 0 then
CanLose.TextColor = &hFF0000
End if

Note that CanLose must have it's Styled flag set to true in the
properties window.

HTH!

~Aaron

Re: Return value Red if negative
Date: 01.02.05 00:47 (Mon, 31 Jan 2005 23:47:03 +0000)
From: Lennox Jacob
Thanks Aaron,
But I have a problem, this is the snippet

R2 = 10
R2 = W-(25*H*H/10000)
CanLose.text = format(R2, "#.##")
if Val(CanLose.Text) < 0 then
CanLose.TextColor = &hFF0000
End if

What happens, is that format(R2, "#.##") does not give back a signed answer,
so I tried
R2 = 10
R2 = W-(25*H*H/10000)
CanLose.text = format(R2, "#.##")
if Val(R2) < 0 then
CanLose.TextColor = &hFF0000
End if

then I used
R2 = 10
R2 = W-(25*H*H/10000)
CanLose.text = format(R2, "#.##")
if R2 < 0 then
CanLose.TextColor = &hFF0000
End if

But I still cannot compile.
Kindly assist again.
Thanks.
Lennox.

>From: Aaron Ballman <<email address removed>>
>Reply-To: Getting Started <<email address removed>>
>To: Getting Started <<email address removed>>
>Subject: Re: Return value Red if negative
>Date: Mon, 31 Jan 2005 17:24:59 -0600
>
>>if CanLose.Text < 0 then
>
>if Val( VanLose.Text ) < 0 then
> CanLose.TextColor = &hFF0000
>End if
>
>Note that CanLose must have it's Styled flag set to true in the properties
>window.
>
>HTH!
>
>~Aaron
>--
>REAL World 2005 - The REALbasic User Conference
>March 23-25, 2005, Austin, Texas
><http://www.realsoftware.com/realworld>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives of this list here:
><http://www.realsoftware.com/listarchives/lists.html>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Return value Red if negative
Date: 01.02.05 00:48 (Mon, 31 Jan 2005 17:48:59 -0600)
From: Aaron Ballman
> What happens, is that format(R2, "#.##") does not give back a signed
> answer, so I tried

Which is normal -- you need Format( r2, "-#.##" )

HTH!

~Aaron

Re: Return value Red if negative
Date: 01.02.05 00:58 (Mon, 31 Jan 2005 15:58:15 -0800)
From: Terry Ford

On 31-Jan-05, at 3:47 PM, Lennox Jacob wrote:

> But I still cannot compile.

Are you getting a compile error or is it just not doing whet you want?

Terry

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Return value Red if negative
Date: 01.02.05 01:06 (Tue, 01 Feb 2005 00:06:22 +0000)
From: Lennox Jacob
Thanks Terry,
I finally got it with Aaron's help.
Thanks.
Lennox.

>From: Terry Ford <<email address removed>>
>Reply-To: Getting Started <<email address removed>>
>To: Getting Started <<email address removed>>
>Subject: Re: Return value Red if negative
>Date: Mon, 31 Jan 2005 15:58:15 -0800
>
>On 31-Jan-05, at 3:47 PM, Lennox Jacob wrote:
>
>>But I still cannot compile.
>
>Are you getting a compile error or is it just not doing whet you want?
>
>Terry
>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives of this list here:
><http://www.realsoftware.com/listarchives/lists.html>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Return value Red if negative
Date: 01.02.05 00:55 (Mon, 31 Jan 2005 23:55:29 +0000)
From: Lennox Jacob
Thanks Aaron,
But still having problems...
CanLose.text = format(R2, "-#.##")
if Val( CanLose.Text ) < 0 then
CanLose.TextColor = &hFF0000
End if
... Expected color, but got integer
Please help again.
Thanks.
Lennox

>From: Aaron Ballman <<email address removed>>
>Reply-To: Getting Started <<email address removed>>
>To: Getting Started <<email address removed>>
>Subject: Re: Return value Red if negative
>Date: Mon, 31 Jan 2005 17:24:59 -0600
>
>>if CanLose.Text < 0 then
>
>if Val( VanLose.Text ) < 0 then
> CanLose.TextColor = &hFF0000
>End if
>
>Note that CanLose must have it's Styled flag set to true in the properties
>window.
>
>HTH!
>
>~Aaron
>--
>REAL World 2005 - The REALbasic User Conference
>March 23-25, 2005, Austin, Texas
><http://www.realsoftware.com/realworld>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives of this list here:
><http://www.realsoftware.com/listarchives/lists.html>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Return value Red if negative
Date: 01.02.05 00:58 (Mon, 31 Jan 2005 17:58:21 -0600)
From: Aaron Ballman

On Jan 31, 2005, at 5:55 PM, Lennox Jacob wrote:

> Thanks Aaron,
> But still having problems...
> CanLose.text = format(R2, "-#.##")
> if Val( CanLose.Text ) < 0 then
> CanLose.TextColor = &hFF0000
> End if
> ... Expected color, but got integer

Ack! Good catch -- that should be &cFF0000 (not &h, which is an
integer, but &c which is a color).

Again, typing in email editor, not code editor... Sorry about that!

~Aaron

Re: Return value Red if negative
Date: 01.02.05 01:05 (Tue, 01 Feb 2005 00:05:14 +0000)
From: Lennox Jacob
Thanks Aaron,
It worked.
Thanks again.
Lennox.

>From: Aaron Ballman <<email address removed>>
>Reply-To: Getting Started <<email address removed>>
>To: Getting Started <<email address removed>>
>Subject: Re: Return value Red if negative
>Date: Mon, 31 Jan 2005 17:58:21 -0600
>
>On Jan 31, 2005, at 5:55 PM, Lennox Jacob wrote:
>
>>Thanks Aaron,
>>But still having problems...
>>CanLose.text = format(R2, "-#.##")
>> if Val( CanLose.Text ) < 0 then
>> CanLose.TextColor = &hFF0000
>> End if
>>... Expected color, but got integer
>
>Ack! Good catch -- that should be &cFF0000 (not &h, which is an integer,
>but &c which is a color).
>
>Again, typing in email editor, not code editor... Sorry about that!
>
>~Aaron
>--
>REAL World 2005 - The REALbasic User Conference
>March 23-25, 2005, Austin, Texas
><http://www.realsoftware.com/realworld>
>_______________________________________________
>Unsubscribe or switch delivery mode:
><http://www.realsoftware.com/support/listmanager/>
>Search the archives of this list here:
><http://www.realsoftware.com/listarchives/lists.html>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>