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,6 +419,18 @@ define List(HTML_Cell(HTML_In_Form)) | ||
| 419 | (t,lto,names,line_format,a_color,b_color,do_sum,total_line,new_value,spacer)] | 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 | public define HTML_In_Form | 435 | public define HTML_In_Form |
| 424 | generic_table | 436 | generic_table |
| @@ -453,7 +465,7 @@ public define HTML_In_Form | @@ -453,7 +465,7 @@ public define HTML_In_Form | ||
| 453 | several(n,sp) then sp | 465 | several(n,sp) then sp |
| 454 | }, | 466 | }, |
| 455 | generic_cells | 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 | lto,names,line_format,a_color,b_color, | 469 | lto,names,line_format,a_color,b_color, |
| 458 | (One u,$Data d) |-> unique,(One _) |-> row([],[]),unique,spacer), | 470 | (One u,$Data d) |-> unique,(One _) |-> row([],[]),unique,spacer), |
| 459 | total(sum_fct,total_line,init) then | 471 | total(sum_fct,total_line,init) then |
| @@ -469,7 +481,7 @@ public define HTML_In_Form | @@ -469,7 +481,7 @@ public define HTML_In_Form | ||
| 469 | }, | 481 | }, |
| 470 | generic_cells | 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 | lto,names,line_format,a_color,b_color, | 485 | lto,names,line_format,a_color,b_color, |
| 474 | sum_fct,total_line,init,spacer | 486 | sum_fct,total_line,init,spacer |
| 475 | ) | 487 | ) |
| @@ -544,7 +556,7 @@ public define HTML_Off_Form | @@ -544,7 +556,7 @@ public define HTML_Off_Form | ||
| 544 | }, | 556 | }, |
| 545 | generic_cells | 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 | lto,names,line_format,a_color,b_color, | 560 | lto,names,line_format,a_color,b_color, |
| 549 | (One u,$Data d) |-> unique,(One _) |-> row([],[]),unique,spacer | 561 | (One u,$Data d) |-> unique,(One _) |-> row([],[]),unique,spacer |
| 550 | ), | 562 | ), |
| @@ -561,7 +573,7 @@ public define HTML_Off_Form | @@ -561,7 +573,7 @@ public define HTML_Off_Form | ||
| 561 | }, | 573 | }, |
| 562 | generic_cells | 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 | lto,names,line_format,a_color,b_color, | 577 | lto,names,line_format,a_color,b_color, |
| 566 | sum_fct,total_line,init,spacer | 578 | sum_fct,total_line,init,spacer |
| 567 | ) | 579 | ) |