Hi Pat,

This should work and is possibly easier to fix or change.
For style purposes
I like using multi-line if I think something could grow more than 3 or using an 
array and then find in array to verify.

I also want you to know that yes we are interested. 🙂

$t:="<CellStyle:"+tTableCellStyleOverride+">"

//Only these columns are valid for override
$bValidColumn:=(\
($hbf="b") | \
($hbf="f") | \
($hbf="h") )

Case of   //Override style

: (ptra2tCellStylesHeader->{$row}{$ElementOrder}=$t)  //All ready set properly
: (Not($bValidColumn))  //Not a valid column
Else   //Valid column and CellStylesHeader needs to be reset

 ptra2tCellStylesBody->{$row}{$ElementOrder}:=$t

End case   //Done override style
________________________________
From: 4D_Tech <[email protected]> on behalf of Pat Bensky via 
4D_Tech <[email protected]>
Sent: Friday, October 4, 2019 10:23 PM
To: 4D iNug Technical <[email protected]>
Cc: Pat Bensky <[email protected]>
Subject: Re: CASE statement = True but it behaves as though it's False

And if anybody's interested, the code now works like this:

$t:="<CellStyle:"+tTableCellStyleOverride+">"

*Case of*   // 04/10/19

*:* ($hbf="h")

*If* (ptra2tCellStylesHeader->{$row}{$ElementOrder}#$t)

ptra2tCellStylesHeader->{$row}{$ElementOrder}:=$t

*End if*

*:* ($hbf="b")

*If* (ptra2tCellStylesBody->{$row}{$ElementOrder}#$t)

ptra2tCellStylesBody->{$row}{$ElementOrder}:=$t

*End if*

*:* ($hbf="f")

*If* (ptra2tCellStylesFooter->{$row}{$ElementOrder}#$t)

ptra2tCellStylesFooter->{$row}{$ElementOrder}:=$t

*End if*

*End case*




On Fri, 4 Oct 2019 at 23:22, Pat Bensky <[email protected]> wrote:

> Fixed it!
> This is what was happening ...
> The array ptra2tCellStylesHeader-> has two rows x 7 columns.
> So after the second iteration, the first Case option
> *:* (($hbf="h") & (ptra2tCellStylesHeader->{$row}{$ElementOrder}#$t))
>
> is erroneous because $row>2. So rather than give an error, it just skips
> through the whole Case statement. I've installed an error handler now :)
>
> Pat
>
>
>
> On Fri, 4 Oct 2019 at 23:06, Pat Bensky <[email protected]> wrote:
>
>> Good suggestion Tim. I tried that but I am still getting bizarre results.
>> This is what I'm doing:
>>
>> 225 $t:="<CellStyle:"+tTableCellStyleOverride+">"
>>
>> 226 $t2:=ptra2tCellStylesBody->{$row}{$ElementOrder}
>>
>> 227 *Case of*   // 04/10/19
>>
>> 228 *:* (($hbf="h") & (ptra2tCellStylesHeader->{$row}{$ElementOrder}#$t))
>>
>> 229 ptra2tCellStylesHeader->{$row}{$ElementOrder}:=$t
>>
>> 230 //: (($hbf="b") & (ptra2tCellStylesBody->{$row}{$ElementOrder}#$t))
>>
>> 231 *:* (($hbf="b") & ($t2#$t))
>>
>> 232 ptra2tCellStylesBody->{$row}{$ElementOrder}:=$t
>>
>> 233 *:* (($hbf="f") & (ptra2tCellStylesFooter->{$row}{$ElementOrder}#$t))
>>
>> 234 ptra2tCellStylesFooter->{$row}{$ElementOrder}:=$t
>>
>> 235 *End case*
>>
>>
>> The Expression window shows that:
>>
>> $t="<CellStyle:gray fill>"
>>
>> $t2=""
>>
>> ptra2tCellStylesBody->{$row}{$ElementOrder}=""
>>
>> ($hbf="b")=True
>>
>> ($t2#$t)=True
>>
>> (($hbf="b") & ($t2#$t))=True
>>
>>
>> So it should pop into line 232. But it doesn't. It pops out of the Case
>> statement to line 236.
>>
>> Screen shot here:
>>
>> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dropbox.com%2Fs%2Froryl0rykuohd8k%2F4D004.png%3Fdl%3D0&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473504312&amp;sdata=%2F2%2F8StnaRkvJo5OVIyzLCo2PPzk0m5qiYzRB84GzMpM%3D&amp;reserved=0
>>
>>
>> Very confusing!
>>
>> And annoying :)
>>
>>
>> Pat
>>
>>
>>
>>
>> On Fri, 4 Oct 2019 at 20:22, Tim Nevels via 4D_Tech <[email protected]>
>> wrote:
>>
>>> On Oct 4, 2019, at 2:00 PM, Pat Bensky wrote:
>>>
>>> > So the first 2 times through, when $hbf="b" and
>>> ptra2tCellStylesBody->{$row}{$ElementOrder}#$t, it populates the cell:
>>> > ptra2tCellStylesBody->{$row}{$ElementOrder}:=$t
>>> >
>>> > Subsequently, it just pops through the Case statement and doesn't
>>> populate
>>> > the cell, even though those 2 test are both True.
>>> >
>>> > In all cases the two tests evaluate to True.
>>> > What can't I see?
>>>
>>> Maybe the 4D interpreter is getting confused with the rather complex 2D
>>> array pointer thing "ptra2tCellStylesBody->{$row}{$ElementOrder}#$t”
>>> expression. You might try setting a simple boolean variable before the case
>>> statement and see if that makes it work.
>>>
>>> $theThing_b:=(ptra2tCellStylesBody->{$row}{$ElementOrder}#$t)
>>>
>>> Tim
>>>
>>> *****************************************
>>> Tim Nevels
>>> Innovative Solutions
>>> 785-749-3444
>>> [email protected]
>>> *****************************************
>>>
>>> **********************************************************************
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  
>>> https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.html&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473514323&amp;sdata=hii0ugvxAHutAfWEj6JmrhQjo2J%2FeLKuOrcSuS35XTw%3D&amp;reserved=0
>>> Options: 
>>> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_tech&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473514323&amp;sdata=2w8WWvei5IFZ7VHPjly1EKM2KLdivvY6UuPktrX6vEc%3D&amp;reserved=0
>>> Unsub:  mailto:[email protected]
>>> **********************************************************************
>>
>>
>>
>> --
>> *************************************************
>> CatBase - Top Dog in Data Publishing
>> tel: +44 (0) 207 118 7889
>> w: 
>> https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catbase.com&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473514323&amp;sdata=sjjl%2Bp5z2iVTFf5njd%2BH6KA5gKOfBedQ5Q%2FNgDbO8WI%3D&amp;reserved=0
>> skype: pat.bensky
>> *************************************************
>>
>
>
> --
> *************************************************
> CatBase - Top Dog in Data Publishing
> tel: +44 (0) 207 118 7889
> w: 
> https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catbase.com&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473514323&amp;sdata=sjjl%2Bp5z2iVTFf5njd%2BH6KA5gKOfBedQ5Q%2FNgDbO8WI%3D&amp;reserved=0
> skype: pat.bensky
> *************************************************
>


--
*************************************************
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: 
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.catbase.com&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473514323&amp;sdata=sjjl%2Bp5z2iVTFf5njd%2BH6KA5gKOfBedQ5Q%2FNgDbO8WI%3D&amp;reserved=0
skype: pat.bensky
*************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.4d.com%2Farchives.html&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473514323&amp;sdata=hii0ugvxAHutAfWEj6JmrhQjo2J%2FeLKuOrcSuS35XTw%3D&amp;reserved=0
Options: 
https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.4d.com%2Fmailman%2Foptions%2F4d_tech&amp;data=02%7C01%7C%7C9a581857aeab439675fa08d7491991e0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637058246473514323&amp;sdata=2w8WWvei5IFZ7VHPjly1EKM2KLdivvY6UuPktrX6vEc%3D&amp;reserved=0
Unsub:  mailto:[email protected]
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to