FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Migrating to Harbour
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 07:50 AM
Cristobal,

cnavarro wrote:This expression works?

Code (fw): Select all Collapse
oSheet:Cells( 1, 1 ):Value = CTOD( "  /  /  " )


No.

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 07:54 AM
Enrico,

Enrico Maria Giordano wrote:Antonio,

Antonio Linares wrote:When you use an empty date with xHarbour what value do you get in the Excel cell ?


NIL

EMG


NIL or NULL ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 09:48 AM
Antonio,

Code (fw): Select all Collapse
? oSheet:Cells( 1, 1 ):Value, VALTYPE( oSheet:Cells( 1, 1 ):Value )


Code (fw): Select all Collapse
NIL U


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 05:16 PM

Enrico,

I meant what do you see in Excel. What is shown is Excel ?

Not the value that you get from Harbour.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 05:31 PM
Antonio,

Antonio Linares wrote:I meant what do you see in Excel. What is shown is Excel ?

Not the value that you get from Harbour.


Sorry. I see an empty cell. So we only need an automatic convertion from CTOD( "" ) to NIL.

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 05:33 PM

Enrico,

have you tried this ?

oSheet:Cells( 1, 1 ):Value = nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 06:09 PM
Antonio,

Antonio Linares wrote:have you tried this ?

oSheet:Cells( 1, 1 ):Value = nil


Yes, I already reported the result. It works.

EMG
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 06:17 PM

As of now there is no way except review all our code and modify wherever dates are assigned.

oSheet:Cells(r,c):NumberFormat := "dd-mm-yyyy" // or similar
oSheet:Cells(r,c):Value := If( Year(d) < 1900, nil, d )

I prefer
oSheet:Cells(r,c):Value := If( Year(d) < 1900, AdoNull(), d )
This works with ADO also.

Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Dec 24, 2014 06:29 PM

Nages,

absolutely impractical... :-(

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Jan 07, 2015 01:42 PM

Dear friends,

any news? I'm stuck with my Harbour migration... :-(

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migrating to Harbour
Posted: Wed Jan 07, 2015 09:20 PM

Enrico,

What is missing ?

I mean, something that really stops you to migrate to Harbour :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Jan 07, 2015 09:24 PM
Antonio,

this one:

Code (fw): Select all Collapse
oSheet:Cells( 1, 1 ):Value = CTOD( "" )


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migrating to Harbour
Posted: Wed Jan 07, 2015 09:33 PM

Enrico,

But this worked fine, right ?

oSheet:Cells( 1, 1 ):Value = nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Migrating to Harbour
Posted: Wed Jan 07, 2015 10:17 PM
Enrico

Can you try something like this ?

Code (fw): Select all Collapse
oSheet:Range( "A:A" ):Set( "NumberFormat", '00/00/00' ) // field mask

// sets headers
oSheet:Cells( 1, 1 ):value  := "Date"
...
...
...

Do while ...
     
     oSheet:Cells( nRow, 1 ):Value  := ctod("")
     ...
     ....
     nRow++
     skip

Enddo


In my code NumberFormat works on Char as well as numeric .. perhaps in it would force the above picture clause on column 1 to 00/00/00 ?

Rick Lipkin
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Migrating to Harbour
Posted: Wed Jan 07, 2015 10:20 PM
Antonio,

Antonio Linares wrote:But this worked fine, right ?

oSheet:Cells( 1, 1 ):Value = nil


Yes. But I have far too many places when dates can be empty.

Anyway, does it make sense that we can assign all empty types except date? These all work:

Code (fw): Select all Collapse
oSheet:Cells( 1, 1 ):Value = ""
oSheet:Cells( 1, 1 ):Value = 0
oSheet:Cells( 1, 1 ):Value = .F.


EMG