,ypos) Copies the contents of the cells in the region in grid source to grid id. xpos and ypos indicate the place where the region must be placed in the grid. (Can also be used to copy values from one place in a grid to another.)
so this indicates that you can easily swap lines. (by using a temporary grid).. Well I tried and found a bug:
grid = ds_grid_create(2,3); tgrid = ds_grid_create(2,5); loc = 4; ////the location is most important! ds_grid_set_region(grid,0,0,ds_grid_width(grid)-1,ds_grid_height(grid)-1,"testvalue"); ds_grid_set_region(tgrid,0,0,ds_grid_width(tgrid)-1,ds_grid_height(tgrid)-1,"t"); ds_grid_set(grid,0,4,"t");ds_grid_set(grid,1,4,"t"); show_message("old grid: "+string(ds_grid_get(grid,0,1))+"||"+string(ds_grid_get(grid,1,1))) ///////////////// ds_grid_set_grid_region(tgrid,grid,0,1,1,1,0,loc); //////////////// show_message("new grid: "+string(ds_grid_get(tgrid,0,loc))+"||"+string(ds_grid_get(tgrid,1,loc)))
when copying to the first or last line in a grid, the copying won't take place! - Even when copying in the same grid!
Well I think it's a bug at least, can somebody test above code, which should point you to the bug? -- It's a pretty big issue and I think it's kind of strange no one has noticed it yet..
Edited by paul23, 09 November 2007 - 12:42 PM.