• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Problem about teh strcat command

Stats

  • Replies 5
  • Subscribers 158
  • Views 14406
  • Members are here 0
More Content

Problem about teh strcat command

archive
archive over 19 years ago

I'm a newcomer, and I'm studying the SKILL.
I wrote some code to report the dummy net pin and single pin( or unconnected pin), then asign the list to a form, browse them one by one. But one problem occured. For some projects, there is a error information for strcat command:
Error* strcat: argument #1 should be either a string or a symbol

The part of code is like this:

let((Pin_List Dummy_Pin_List Single_Pin_List)
Pin_List=Dummy_Pin_List=Single_Pin_List=nil
foreach( item Pin_List
if(item->net->name=="" then
Dummy_Pin_List=cons(strcat(item->component->name "." item->number) Dummy_Pin_List)
Dummy_Pin_List=sort(Dummy_Pin_List 'alphalessp)
else
if(length(item->branch->children)==1 then
Single_Pin_List=cons(strcat(item->component->name "." item->number " / " item->net->name) Single_Pin_List)
Single_Pin_List=sort(Single_Pin_List 'alphalessp)
);if
);if
);foreach
);let

Who can help me with this problem. thanks.


Originally posted in cdnusers.org by leonlee
  • Sign in to reply
  • Cancel
  • archive
    archive over 19 years ago

    of course

    The Pin_List is generateed by below code:

    axlDBRefreshId(axlDBGetDesign())
    axlClearSelSet()
    axlSetFindFilter(?enabled '(noall pins) ?onButtons '(noall pins))
    Pin_List=axlGetSelSet(axlAddSelectAll())


    Originally posted in cdnusers.org by leonlee
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 19 years ago

    You are getting every pin record in the board database. Some of theins may be mechanical pins which have no number value. Then when you strcat item -> number strcat fails as you are seeing.

    Try adding a conditional that traps null item -> numbers
    For example
    if(item -> number != nil then


    Originally posted in cdnusers.org by AshCan
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 19 years ago

    OK, thank you very much for your answer.
    I'll try it soon~~~


    Originally posted in cdnusers.org by leonlee
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 19 years ago

    Another technique to address unwanted nil values is to use OR:
    strcat(x y item->number||"" z)
    Since 'or' stop evaluating on non-nil ("true") values from left to right.

    And not related to your question - you should sort once after
    the foreach statement (for improved performance).


    Originally posted in cdnusers.org by natan
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • archive
    archive over 19 years ago

    Ok, the reason is:

    for the mechanical pin, item->component=nil item->nuber=""(null)

    I ignored it~~~


    Originally posted in cdnusers.org by leonlee
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information