Function MultiboardSetItemValueBJ
- Line
- 6254
- Location
- blizzard.j
- Constant?
- no
- Type
- function
- Arguments
- multiboard mb, integer col, integer row, string val
- Returns
- nothing
| 6254 | function MultiboardSetItemValueBJ takes multiboard mb, integer col, integer row, string val returns nothing |
| 6255 | local integer curRow = 0 |
| 6256 | local integer curCol = 0 |
| 6257 | local integer numRows = MultiboardGetRowCount(mb) |
| 6258 | local integer numCols = MultiboardGetColumnCount(mb) |
| 6259 | local multiboarditem mbitem = null |
| 6260 | |
| 6261 | // Loop over rows, using 1-based index
|
| 6262 | loop
|
| 6263 | set curRow = curRow + 1 |
| 6264 | exitwhen curRow > numRows |
| 6265 | |
| 6266 | // Apply setting to the requested row, or all rows (if row is 0)
|
| 6267 | if (row == 0 or row == curRow) then |
| 6268 | // Loop over columns, using 1-based index
|
| 6269 | set curCol = 0 |
| 6270 | loop
|
| 6271 | set curCol = curCol + 1 |
| 6272 | exitwhen curCol > numCols |
| 6273 | |
| 6274 | // Apply setting to the requested column, or all columns (if col is 0)
|
| 6275 | if (col == 0 or col == curCol) then |
| 6276 | set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1) |
| 6277 | call MultiboardSetItemValue(mbitem, val) |
| 6278 | call MultiboardReleaseItem(mbitem) |
| 6279 | endif
|
| 6280 | endloop
|
| 6281 | endif
|
| 6282 | endloop
|
| 6283 | endfunction
|