Topic: Problem with cell color
author: Juzan Jean-Michel
created: 16-08-2002 06:39:05 AM
|
Hi John,
In powerlens a function, who return the number of record
=compteStockCategorie($StockID,{id})
in Cell Color
=({col3} > 0)?"green":"red"
Parse error: parse error in /usr/local/httpd/phptools/phplens/phplens-core2.inc.php(1599) : eval()'d code on line 1
Regards. |
|
Topic: Re:Problem with cell color
author: Juzan Jean-Michel
created: 16-08-2002 06:49:16 AM
|
Why I can't make this in Cell Color
=(compteStockCategorie($StockID,{id}) > 0)?"green":"red" |
|
Topic: Re:Problem with cell color
author: John Lim
created: 16-08-2002 06:56:27 AM
|
Although $StockID is a global, we have not declared it as global in our code, so you have to use:
$GLOBALS['StockID']
currently. |
|
Topic: Re:Problem with cell color
author: John Lim
created: 16-08-2002 06:58:08 AM
|
Some more explanation.
We allow PHP global vars in sql statements (such as lookupLens and sql properties), but do not translate in PHP code such as '=' in powerLens, colorLens, because we would have to scan your code and declare "global $var" for all your variables. This is tricky and might not work properly.
For sql it is easy:
Eg. $lens->sql = 'select * from $table';
we convert to 'select * from '.$GLOBALS['table']
However for objects:
$lens->lookupLens = 'COL^=$VAR->Print()';
cannot be converted to
$GLOBALS['VAR']->Print()
as this will cause a syntax error.
Regards, John |
|
Topic: Re:Problem with cell color
author: John Lim
created: 16-08-2002 07:04:01 AM
|
There are a few special exceptions. All superglobal vars such as $_POST, $_GET are recognized of course. We also pre-declare for you $PHP_SELF because it is so useful. |
|
Topic: Re:Problem with cell color
author: Juzan Jean-Michel
created: 16-08-2002 08:18:14 AM
|
Thank's for explanation
but you don't have reply about
In powerlens a function, who return the number of record
=compteStockCategorie($StockID,{id})
in Cell Color
=({col3} > 0)?"green":"red"
Parse error: parse error in /usr/local/httpd/phptools/phplens/phplens-core2.inc.php(1599) : eval()'d code on line 1 |
|
Topic: Re:Problem with cell color
author: John Lim
created: 16-08-2002 09:15:38 AM
|
This problem:
=({col3} > 0)?"green":"red"
I just tested and it works fine on my test machine. I don't know why this is happening. Perhaps converting to a function might help as it is easier to debug.
eg.
=GetColor({col3}) |
|