This can be tricky. I wouldn't recommend attempting this unless you have some prior game making experience.
Probably the best way is to store items in a series of arrays. For example, you can keep the names of items in your inventory like this:
item[1]$ = "Potion"
item[2]$ = "Ether"
...
Etc. And how many items of each you have in a parellel array:
itemcount[1]! = 2
itemcount[2]! = 3
You can list these side by side in a menu like this:
y!=10
for(i!=1;i! < maxitems!; i!++)
{
text(10,y!,item[1]$)
text(10,y!,itemcount[1]!)
y!++
}
And get a result like:
Potion 2
Ether 3
Now, if you want to use an item, you can write a method that runs each time the item is used. Say Use_Potion() is your potion method. You can do something like
// i! is the number of the item being used
rpgcode("Use_" + item[i!]$)
itemcount[i!]!--
In the above case, if i! is 1, then the Use_Potion() method would be called and the number of potions in stock would be decreased.
That just scratches the surface, but it should give you an idea of where you need to go.