code2go
Posts: 13
|
| Posted: 04/17/2008, 8:54 AM |
|
I recently converted to 4.0. I have several labels that are "Totals" for other labels. The code looks like this:
global $topsdata; // This is the component
$topsvalue= $topsdata->sharePayout->Value + $topsdata->loanValue->Value+
$topsdata->mscCRval->Value+$topsdata->mscGAPval->Value+
$topsdata->mscMFSRval->Value+$topsdata->gwval->Value+$topsdata->qloopPayout->Value;
$Component->setValue($topsvalue);
This worked in 3.x. Any ideas of what I'm doing wrong?
|
 |
 |
DonP
|
| Posted: 04/17/2008, 9:29 AM |
|
At a glance, it doesn't look like CCS 3 or CCS 4 code. It should be
something like this:
$topsvalue= $topsdata->sharePayout->GetValue() +
$topsdata->loanValue->GetValue() +
$topsdata->mscCRval->GetValue + $topsdata->mscGAPval->GetValue() +
$topsdata->mscMFSRval->GetValue() + $topsdata->gwval->GetValue() +
$topsdata->qloopPayout->GetValue();
$Component->SetValue($topsvalue);
Don (DonP)
code2go wrote:
> I recently converted to 4.0. I have several labels that are "Totals" for other
> labels. The code looks like this:
> global $topsdata; // This is the component
>
> $topsvalue= $topsdata->sharePayout->Value + $topsdata->loanValue->Value+
> $topsdata->mscCRval->Value+$topsdata->mscGAPval->Value+
> $topsdata->mscMFSRval->Value+$topsdata->gwval->Value+$topsdata->qloopPayout->Value;
> $Component->setValue($topsvalue);
>
> This worked in 3.x. Any ideas of what I'm doing wrong?
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
code2go
Posts: 13
|
| Posted: 04/17/2008, 9:51 AM |
|
It seems that somehow, during the conversion, the code for my labels switched order. So the total label code came before the labels I'm getting the values for. Moving the code around, it works fine.
Weird, but true.
Thanks
|
 |
 |
DonP
|
| Posted: 04/17/2008, 10:01 AM |
|
The order shouldn't make any difference. If these values are coming from
a dataset, you can also use something like:
$topsdata->ds->f("sharePayout") + . . .
where sharePayout is the name of a field in the database.
I'm going from memory here as I do not have CCS on this system. Anyway,
glad it's working now!
Don (DonP)
code2go wrote:
> It seems that somehow, during the conversion, the code for my labels switched
> order. So the total label code came before the labels I'm getting the values
> for. Moving the code around, it works fine.
>
> Weird, but true.
>
>
> Thanks
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
code2go
Posts: 13
|
| Posted: 04/17/2008, 10:07 AM |
|
No, the data does not come from the table.
|
 |
 |
|