From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17030 invoked by alias); 20 Oct 2004 21:36:00 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 17005 invoked from network); 20 Oct 2004 21:35:59 -0000 Received: from unknown (HELO antivirus.talgentra.co.nz) (203.167.214.133) by sourceware.org with SMTP; 20 Oct 2004 21:35:59 -0000 Received: from 10.64.2.9 by antivirus.talgentra.co.nz (InterScan E-Mail VirusWall NT); Thu, 21 Oct 2004 10:35:57 +1300 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Type identification within a user defined commands Date: Wed, 20 Oct 2004 22:22:00 -0000 Message-ID: <7D8E31C9DCC5204AB4AA23315B352F5B2F0DE6@exchange.talgentra.co.nz> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Brendan Doherty" To: X-SW-Source: 2004-10/txt/msg00386.txt.bz2 Is it possible to identify the type of a variable passed to a user defined command. I'm trying to create a prettier print that displays information about the various classes that we use. I want to use the type to access attributes specific to that class. What I am trying to do is considerable more complex than the example below, bug it demostrates what I want to do. EXAMPLE =3D=3D=3D=3D=3D=3D=3D=20 define myprint set $classtype =3D (whatis $arg0) if $classtype =3D dog then printf "Dog:\n" printf "Name: %s\n", $arg0->name->str printf "Number of holes dug: %d\n, $arg0->numholes=20=20=20=20 else=20 if $classtype =3D bird printf "Bird:\n" printf "Name: %s\n", $arg0->name->str printf "Number of worms: %d\n, $arg0->numworms end end end