Migrating to Harbour
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Rick,
it would require too much work, sorry.
EMG
it would require too much work, sorry.
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Migrating to Harbour
Enrico,
You could use a function that does the job automatically:
oSheet:Cells( 1, 1 ):Value = MyCheckDate( ... )
function MyCheckDate( u )
return If( Empty( u ), nil, CToD( u ) )
You can modify it based on your needs.
You could use a function that does the job automatically:
oSheet:Cells( 1, 1 ):Value = MyCheckDate( ... )
function MyCheckDate( u )
return If( Empty( u ), nil, CToD( u ) )
You can modify it based on your needs.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Antonio,
ok, but I would have to check tons of lines of code to look for the places where to put that function.
As I already said: impractical...
This is clearly an Harbour bug. We can assign any empty types except date. Illogical.
EMG
ok, but I would have to check tons of lines of code to look for the places where to put that function.
As I already said: impractical...
This is clearly an Harbour bug. We can assign any empty types except date. Illogical.
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Migrating to Harbour
Enrico,
Do you get an error with Harbour on this code ?
oSheet:Cells( 1, 1 ):Value = CToD( "" )
Which error ?
What about using TRY ... CATCH ... END ?
Do you get an error with Harbour on this code ?
oSheet:Cells( 1, 1 ):Value = CToD( "" )
Which error ?
What about using TRY ... CATCH ... END ?
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Antonio,
EMG
Antonio Linares wrote:Do you get an error with Harbour on this code ?
oSheet:Cells( 1, 1 ):Value = CToD( "" )
Which error ?
Code: Select all
Error WINOLE/1006 (0x800A03EC): _VALUE (DOS Error -2147352567)
Called from TOLEAUTO:_VALUE(0)
Called from MAIN(11)
Too much work.Antonio Linares wrote:What about using TRY ... CATCH ... END ?
EMG
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Migrating to Harbour
oSheet:Cells( 1, 1 ):Value = CToD( "" )
Isn't that a direct call to the Excel API? If so, it would seem that it is an Excel issue not a Harbour issue. But then, I don't understand why it would work with xHarbour unless the pre-processor is changing the code.
Any chance that you are comparing two different versions of Excel--one using Harbour and another with xHarbour?
Isn't that a direct call to the Excel API? If so, it would seem that it is an Excel issue not a Harbour issue. But then, I don't understand why it would work with xHarbour unless the pre-processor is changing the code.
Any chance that you are comparing two different versions of Excel--one using Harbour and another with xHarbour?
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
James,
EMG
It makes no sense that we can assign all empty types except date, isn't it?James Bott wrote:oSheet:Cells( 1, 1 ):Value = CToD( "" )
Isn't that a direct call to the Excel API? If so, it would seem that it is an Excel issue not a Harbour issue.
No, it's not the preprocessor, it's internal xHarbour OLE management that fixes the problem. Harbour should do the same, in my opinion.James Bott wrote:But then, I don't understand why it would work with xHarbour unless the pre-processor is changing the code.
No, sorry. But you can use my sample as it is. It's a complete sample.James Bott wrote:Any chance that you are comparing two different versions of Excel--one using Harbour and another with xHarbour?
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Migrating to Harbour
Enrico,
Its just a workaround, but what do you think if you use a modified function CToD() ?
If you agree on that, then I will help you to build it
Its just a workaround, but what do you think if you use a modified function CToD() ?
If you agree on that, then I will help you to build it
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Migrating to Harbour
Enrico,
Actually 0 and .f. are valid data, are they not? Are you saying they are converted to nil before putting the data into Excel?Anyway, does it make sense that we can assign all empty types except date? These all work:
oSheet:Cells( 1, 1 ):Value = ""
oSheet:Cells( 1, 1 ):Value = 0
oSheet:Cells( 1, 1 ):Value = .F.
What are you basing this on? I know that I have used third-party libraries (that Harbour does not have any knowledge of) to pass data in a similar manner. So, at least in this case, there is no processing by Harbour, unless maybe it is generic. Do you know for a fact that this is happening or are you making an assumption?No, it's not the preprocessor, it's internal xHarbour OLE management that fixes the problem. Harbour should do the same, in my opinion.
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Migrating to Harbour
Antonio,
I thought of this too, but then it would be returning nil to the entire program and there are probably other places where this would crash, like in saving to a DBF.Its just a workaround, but what do you think if you use a modified function CToD() ?
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Antonio,
when birthdate field is empty? There's no way out other than fix Harbour...
EMG
And what aboutAntonio Linares wrote:Its just a workaround, but what do you think if you use a modified function CToD() ?
If you agree on that, then I will help you to build it
Code: Select all
oSheet:Cells( 1, 1 ):Value = FIELD -> birthdate
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Antonio,
EMG
Yes, just like CTOD( "" ).James Bott wrote:Actually 0 and .f. are valid data, are they not?Anyway, does it make sense that we can assign all empty types except date? These all work:
oSheet:Cells( 1, 1 ):Value = ""
oSheet:Cells( 1, 1 ):Value = 0
oSheet:Cells( 1, 1 ):Value = .F.
This is from xHarbour hbwinole.c:James Bott wrote:Are you saying they are converted to nil before putting the data into Excel?
What are you basing this on? I know that I have used third-party libraries (that Harbour does not have any knowledge of) to pass data in a similar manner. So, at least in this case, there is no processing by Harbour, unless maybe it is generic. Do you know for a fact that this is happening or are you making an assumption?No, it's not the preprocessor, it's internal xHarbour OLE management that fixes the problem. Harbour should do the same, in my opinion.
Code: Select all
case HB_IT_DATE:
if( pItem->item.asDate.value == 0 )
{
PHB_V_VT( pVariant ) = VT_NULL;
}
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Migrating to Harbour
Friends
We are all beating around the bush.
Let us not think that EMG does not know workarounds or that he is not capable of finding on his own. No point in keep advising him to implement work arounds.
The fact is that this is bug in Harbour well known for a long time. This is a problem not only for excel but also for ADO.
His point is that he has large existing code and it is extremely difficult to implement work arounds everywhere. It is true. Imagine that any work around is to be implemented for every assignment.
He is speaking not only on his own behalf. Rather on behalf of many programmers who want to migrate.
We are all beating around the bush.
Let us not think that EMG does not know workarounds or that he is not capable of finding on his own. No point in keep advising him to implement work arounds.
The fact is that this is bug in Harbour well known for a long time. This is a problem not only for excel but also for ADO.
His point is that he has large existing code and it is extremely difficult to implement work arounds everywhere. It is true. Imagine that any work around is to be implemented for every assignment.
He is speaking not only on his own behalf. Rather on behalf of many programmers who want to migrate.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Migrating to Harbour
Hello,
So I beleive that the better solution will be to post those comments in the Harbour Developer forum.
Thanks.
So I beleive that the better solution will be to post those comments in the Harbour Developer forum.
Thanks.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Migrating to Harbour
Rao,
EMG
Thank you! Perfect!nageswaragunupudi wrote:Friends
We are all beating around the bush.
Let us not think that EMG does not know workarounds or that he is not capable of finding on his own. No point in keep advising him to implement work arounds.
The fact is that this is bug in Harbour well known for a long time. This is a problem not only for excel but also for ADO.
His point is that he has large existing code and it is extremely difficult to implement work arounds everywhere. It is true. Imagine that any work around is to be implemented for every assignment.
He is speaking not only on his own behalf. Rather on behalf of many programmers who want to migrate.
EMG