When programming in 4D Calc, you may want to programmatically assign a border format to a set of cells. The code you would use would look as follows:
In this example the code was attached to a button. The idea is to define a range of cells and apply the border format afterwards. Please note that when you select a range of cells in 4D Calc using SP SELECT RANGE, the bottom right cell parameter will delimit the first row/column OUTSIDE the cell range. In the example above a type "4" border is applied to the outside of the cell range.
Copy and paste the following code example into your own 4D project:
:Form event=On clicked
$TopLeft:=SP Cell (2;2)
$BottomRight:=SP Cell (4;4)
SP SELECT RANGE (MyCalcArea;$TopLeft;$BottomRight)
SP NEW BORDER (MyCalcArea;1 )