Jump to content

Lisp: How do I count the items in a list?


ajs

Recommended Posts

Can anyone tell me the syntax on how to obtain the amount of items that are in a particular list?

 

Something to the effect of:

 

(setq MyListLength (Quantity MyList)) wherein "Quantity" is the function that obtains the total amount of the components that make up MyList.

 

I typically have a list that stores various coordinates and I need to know how many coordinates the list is holding at any given time.

 

MyList:

 

((168.000 2.00000 0.000000) (68.0000 2.00000 0.000000) (68.0000 26.0000 0.000000) (69.0000 26.0000 0.000000))

 

So in this case, I'd be looking for the count to be 4.

 

 

Any help would be appreciated.

 

---Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...