[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: PCB - How To Find A Component?
Hi all,
On Mon, 2009-02-16 at 20:23 -0500, DJ Delorie wrote:
> > Maybe I'm overlooking something very obvious and better should restart
> > tomorrow morning after some coffee.
>
> Close! Elements don't always have names. You also didn't check for
> missing arguments. Try this bit of code:
>
>
> if (argc == 0 || strcasecmp (argv[0], "") == 0)
> {
> Message ("WARNING: in FindElement the argument should be a non-empty string value.\n");
> return 0;
> }
> else
> {
>
> SET_FLAG (NAMEONPCBFLAG, PCB);
> ELEMENT_LOOP(PCB->Data);
> {
> if (NAMEONPCB_NAME(element)
> && strcmp (argv[0], NAMEONPCB_NAME(element)) == 0)
> {
>
Thanks DJ ;-)
The final version of the FindElement plug-in is to be found here:
http://www.xs4all.nl/~ljh4timm/downloads/findelement.c
Kind regards,
Bert Timmerman.
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user