Migrating to Harbour

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Dec 24, 2014 7:50 am

Cristobal,

cnavarro wrote:This expression works?

Code: Select all  Expand view  RUN

oSheet:Cells( 1, 1 ):Value = CTOD( "  /  /  " )
 


No.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Wed Dec 24, 2014 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Dec 24, 2014 9:48 am

Antonio,

Code: Select all  Expand view  RUN
? oSheet:Cells( 1, 1 ):Value, VALTYPE( oSheet:Cells( 1, 1 ):Value )


Code: Select all  Expand view  RUN
NIL U


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Wed Dec 24, 2014 5: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Dec 24, 2014 5: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
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Wed Dec 24, 2014 5:33 pm

Enrico,

have you tried this ?

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Dec 24, 2014 6: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
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby nageswaragunupudi » Wed Dec 24, 2014 6: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
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Dec 24, 2014 6:29 pm

Nages,

absolutely impractical... :-(

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Jan 07, 2015 1:42 pm

Dear friends,

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Wed Jan 07, 2015 9:20 pm

Enrico,

What is missing ?

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby Enrico Maria Giordano » Wed Jan 07, 2015 9:24 pm

Antonio,

this one:

Code: Select all  Expand view  RUN
oSheet:Cells( 1, 1 ):Value = CTOD( "" )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Migrating to Harbour

Postby Antonio Linares » Wed Jan 07, 2015 9:33 pm

Enrico,

But this worked fine, right ?

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Migrating to Harbour

Postby Rick Lipkin » Wed Jan 07, 2015 10:17 pm

Enrico

Can you try something like this ?

Code: Select all  Expand view  RUN

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
User avatar
Rick Lipkin
 
Posts: 2667
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Migrating to Harbour

Postby Enrico Maria Giordano » 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: Select all  Expand view  RUN
oSheet:Cells( 1, 1 ):Value = ""
oSheet:Cells( 1, 1 ):Value = 0
oSheet:Cells( 1, 1 ):Value = .F.


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 27 guests

cron