CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #16  
Old 06-18-2010, 12:08 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Re: Configuration

Quote:
Originally Posted by Wolfgang View Post
Yes.. it's so nice to type
Code:
(nth 7 your-list)
I personally prefer (car ..), (cadr..) and when I need more using (nth ...).
Keep in mind (as Wolfgang showed, referring to your "eighth") that when using (nth ...) that the count starts with 0!

In other words, (first mylist) is the same as (nth 0 mylist)...

This one often causes problems for people the first time they try it, so hopefully this will help!
__________________
Andy Poulsen
AI MAXTools: Dream. Design. Done. It's that easy!
Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote
  #17  
Old 06-20-2010, 10:42 PM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Configuration

Hi,

haha, yes, difficult word... nth or car is better, indeed.
But actually, John answered my question in his example code:
Code:
(display (getf (sd-inq-configuration-props obj) :name))
That's what I was looking for :-)
Regards,
Jaap
Reply With Quote
  #18  
Old 06-21-2010, 09:24 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Configuration

Quote:
Originally Posted by jkramer View Post
John answered my question in his example code:
Code:
(display (getf (sd-inq-configuration-props obj) :name))
Oh :-o .. a PROPERTY list.. I did not look carefully enough. My eyes were catched by the eihght.

When you have a property list, meaning list of key-value-pairs like
Code:
(list :key-x value-x  :key-z value-z   :key-y value-y  ..... )
you definitely should access it with getf / setf using the keys to reference the values.

Otherwise you would not use the advantage to of the props list. E.g. with (nth .. ) (eighth...) or whatever you would depend on the order within the list. But the sequence within a property list is and must and will not be guaranteed!
Reply With Quote
  #19  
Old 06-21-2010, 10:44 PM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Configuration

Yes, I knew I should use a key value, but could'nt find an example...
Thnx,
Jaap
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:52 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
You Rated this Thread: