Home > Archive > Programming with dBASE > November 2006 > Writting a Logical Value to a Text File









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Writting a Logical Value to a Text File
Dulux

2006-11-16, 12:19 am

Could someone please tell me why the following line of code fails when the
value of the field is a Logical (ie true/false)
this.f1.write(this.q1.rowset.fields[i].value)

In other words it fails when
this.q1.rowset.fields[i].logicaltype == "BOOL"

Any and all help appreciated

dulux



Jan Hoelterling

2006-11-16, 7:13 pm

Hi Matthew,

try to transform the value into text like this:

this.f1.write( iif( this.q1.rowset.fields[i].value ,"TRUE","FALSE") )

Hope this helps,

Jan


Dulux

2006-11-16, 7:13 pm

Excellent!

Thanks Jan.

Its amazing how different minds can come up with different solutions.

When I was playing with this I was using the command
?this.q1.rowset.fields[i].value
and getting either "true" or "false" appearing in the command window, but I
just couldn't seem to get it to work as I wrote it to a file.

Thanks again

matt

PS: Don't spose you've got a solution to my other problem - the one I posted
5 days ago under the heading "Using a Grid as a mini-Spreadsheet"? <grin>

"Jan Hoelterling" <jan@hoelterling.com> wrote in message
news:2X$ICwXCHHA.1332@news-server...
> Hi Matthew,
>
> try to transform the value into text like this:
>
> this.f1.write( iif( this.q1.rowset.fields[i].value ,"TRUE","FALSE") )
>
> Hope this helps,
>
> Jan
>
>



Jan Hoelterling

2006-11-16, 7:13 pm


"Dulux" <dulux@wildit.net.au> wrote in message
news:Zq48jXZCHHA.1332@news-server...
> PS: Don't spose you've got a solution to my other problem - the one I
> posted 5 days ago under the heading "Using a Grid as a mini-Spreadsheet"?
> <grin>


check your email ;-)

Jan


Ivar B. Jessen

2006-11-17, 5:17 am

On Thu, 16 Nov 2006 15:49:19 +1000, in dbase.programming,
Subject: Writting a Logical Value to a Text File,
Message-ID: <xmHUcSUCHHA.336@news-server>,
"Dulux" <dulux@wildit.net.au> wrote:

>Could someone please tell me why the following line of code fails when the
>value of the field is a Logical (ie true/false)
> this.f1.write(this.q1.rowset.fields[i].value)
>
>In other words it fails when
> this.q1.rowset.fields[i].logicaltype == "BOOL"
>
>Any and all help appreciated



Try this: this.f1.write(""+this.q1.rowset.fields[i].value)


Ivar B. Jessen
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com