I have a list that I need to remove the last three items from. The problem is, the items can be anything (text, numbers, special characters). Normally that wouldn't be a problem with the #delnitem command, but the list can be any number of items. There isn't really an effective way to count the number of items (the list is from a .txt file and changes constantly). Are there any ways to use pattern matching in the %replace or %remove functions, or anything similar? Something like this: #var matches %replace( @list, "^[alias-%-1] *$", "")
You can count the number of items in the list by using %numitems. Thus, you can do this to remove the last three items:
#DELNITEM list %numitems(@list)
#DELNITEM list %numitems(@list)
#DELNITEM list %numitems(@list)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum