Commit 4433de370dc184a5b4a30e7af75e4a95a03e927d
1 parent
71498ca8
Added 'mod' function for Ints
Showing
1 changed file
with
16 additions
and
4 deletions
Show diff stats
calexium_lib/web/CXM_generic_table.anubis
| ... | ... | @@ -419,6 +419,18 @@ define List(HTML_Cell(HTML_In_Form)) |
| 419 | 419 | (t,lto,names,line_format,a_color,b_color,do_sum,total_line,new_value,spacer)] |
| 420 | 420 | ] |
| 421 | 421 | }. |
| 422 | + | |
| 423 | +public define Int | |
| 424 | + Int x (mod Int y) | |
| 425 | + = | |
| 426 | + if x / y is | |
| 427 | + { | |
| 428 | + failure then 0, | |
| 429 | + success(result) then | |
| 430 | + if result is (q, r) then r | |
| 431 | + }. | |
| 432 | + | |
| 433 | + | |
| 422 | 434 | |
| 423 | 435 | public define HTML_In_Form |
| 424 | 436 | generic_table |
| ... | ... | @@ -453,7 +465,7 @@ public define HTML_In_Form |
| 453 | 465 | several(n,sp) then sp |
| 454 | 466 | }, |
| 455 | 467 | generic_cells |
| 456 | - (short_lists(l,nbl/col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 468 | + (short_lists(l,nbl\col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 457 | 469 | lto,names,line_format,a_color,b_color, |
| 458 | 470 | (One u,$Data d) |-> unique,(One _) |-> row([],[]),unique,spacer), |
| 459 | 471 | total(sum_fct,total_line,init) then |
| ... | ... | @@ -469,7 +481,7 @@ public define HTML_In_Form |
| 469 | 481 | }, |
| 470 | 482 | generic_cells |
| 471 | 483 | ( |
| 472 | - short_lists(l,nbl/col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 484 | + short_lists(l,nbl\col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 473 | 485 | lto,names,line_format,a_color,b_color, |
| 474 | 486 | sum_fct,total_line,init,spacer |
| 475 | 487 | ) |
| ... | ... | @@ -544,7 +556,7 @@ public define HTML_Off_Form |
| 544 | 556 | }, |
| 545 | 557 | generic_cells |
| 546 | 558 | ( |
| 547 | - short_lists(l,nbl/col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 559 | + short_lists(l,nbl\col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 548 | 560 | lto,names,line_format,a_color,b_color, |
| 549 | 561 | (One u,$Data d) |-> unique,(One _) |-> row([],[]),unique,spacer |
| 550 | 562 | ), |
| ... | ... | @@ -561,7 +573,7 @@ public define HTML_Off_Form |
| 561 | 573 | }, |
| 562 | 574 | generic_cells |
| 563 | 575 | ( |
| 564 | - short_lists(l,nbl/col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 576 | + short_lists(l,nbl\col_nb + if (nbl (mod col_nb)) > 0 then 1 else 0,0), | |
| 565 | 577 | lto,names,line_format,a_color,b_color, |
| 566 | 578 | sum_fct,total_line,init,spacer |
| 567 | 579 | ) | ... | ... |