If I've understood the question correctly, I think you can do this with a 2 dimensional array.
Let's say you have a 6 by 4 grid
Create an array object and set the size x=6, y=4, z=1. Rename the array to be called GRID.
The data in your array will look like this (remember C2 arrays are zero based so the first row or column is 0 and the highest is (width-1):
x
012345
y
0 000000
1 000000
2 000000
3 000000
So now you want to put in a destroyer, which is 3 squares long, (and ship type 1) starting in the top left going horizontally. And a frigate (ship type =2) which is 2 squares long, starting in the bottom right and going vertically.
You can do this by creating actions:
GRID Set value at (0,0) to 1
GRID Set value at (1,0) to 1
GRID Set value at (2,0) to 1
GRID Set value at (5,2) to 2
GRID Set value at (5,3) to 2
Now the data in your array will look like this:
x
012345
y
0 111000
1 000000
2 000002
3 000002
And you can see what ship is where. You can also do error checking to make sure you are not placing a new ship where one already is, and update the values in the array when a ship gets hit.
Hope this helps.