I just identified a problem with an application I've recently upgraded from VFP6 to VFP9.
The application does a little OLE Automation with Excel, which reads the contents of an existing spreadsheet (uploaded via a website) looking for anything entered
in a cell.
In VFP6 I was taking the cell value and dropping it into a variable - then testing to see if the variable was empty:
And it has worked for years... where there is something in the cell it isn't empty and does one thing, where it has nothing in it - it does the other thing, because the EMPTY()
test fails.
but after the upgrade, the temporary variable contains a .Null. value, which is interpreted differently... so I have had to change the code to look like this:
Testing for the .Null. value explicitly seems to get around the problem.
My thinking is that there is a 'SET' which is different by default, but I don't see one Set("NULL") returns OFF in both cases - does anyone have any ideas?
Martin
Regards
Griff
Keep [Smile]ing
There are 10 kinds of people in the world, those who understand binary and those who don't.
The application does a little OLE Automation with Excel, which reads the contents of an existing spreadsheet (uploaded via a website) looking for anything entered
in a cell.
In VFP6 I was taking the cell value and dropping it into a variable - then testing to see if the variable was empty:
Code:
m.TEMPVAL = OEXCEL.CELLS(1,9).VALUE
IF !EMPTY(m.TEMPVAL)
... do something
ELSE
... do something else
ENDIF
And it has worked for years... where there is something in the cell it isn't empty and does one thing, where it has nothing in it - it does the other thing, because the EMPTY()
test fails.
but after the upgrade, the temporary variable contains a .Null. value, which is interpreted differently... so I have had to change the code to look like this:
Code:
m.TEMPVAL = OEXCEL.CELLS(1,9).VALUE
IF !EMPTY(m.TEMPVAL) .AND. !ISNULL(M.TEMPVAL)
... do something
ELSE
... do something else
ENDIF
Testing for the .Null. value explicitly seems to get around the problem.
My thinking is that there is a 'SET' which is different by default, but I don't see one Set("NULL") returns OFF in both cases - does anyone have any ideas?
Martin
Regards
Griff
Keep [Smile]ing
There are 10 kinds of people in the world, those who understand binary and those who don't.