>From root Wed Mar 22 22:09:03 1995 Received: from CONCRETE.RESNET.UPENN.EDU by campus.col.itesm.mx (AIX 3.2/UCB 5.64/4.03) id AA13867; Wed, 22 Mar 1995 22:08:57 GMT Received: (from majordomo@localhost) by concrete.resnet.upenn.edu (8.6.10/8.6.9) id WAA18656 for circle-go-out-and-mail-em; Wed, 22 Mar 1995 22:39:31 -0500 Received: from pioneer.nevada.edu (pioneer.nevada.edu [131.216.1.95]) by concrete.resnet.upenn.edu (8.6.10/8.6.9) with ESMTP id WAA18651 for <circle@concrete.resnet.upenn.edu>; Wed, 22 Mar 1995 22:39:29 -0500 Received: (madison@localhost) by pioneer.nevada.edu (8.6.10/8.6.4) id TAA00790; Wed, 22 Mar 1995 19:39:28 -0800 Date: Wed, 22 Mar 1995 19:39:27 -0800 (PST) From: Melissa <madison@nevada.edu> To: circle@concrete.resnet.upenn.edu Subject: question Message-Id: <Pine.OSF.3.91.950322192810.21343A-100000@pioneer.nevada.edu> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: circle-owner@concrete.resnet.upenn.edu Precedence: bulk Status: R This is prolly classified as a dumb newbie question, so feel free to flame... Below is an excerpt from shop.c It's the part that lists items and their cost with my new coin types added in. My question is, if platinum is equal to 0, how can I not display that? Kinda looks stupid as: sleeves 0 0 1 9, should be: sleeves 1 9 sprintf(buf2, "%-30s &+W%6d &+Y%6d &+W%6d &+y%6d\n\r&+w", buf3, buy_price_platinum(obj, shop_nr), buy_price_gold(obj, shop_nr), buy_price_silver(obj, shop_nr), buy_price_copper(obj, shop_nr)) My best guess is to do something like if (!buy_price_platinum(obj, shop_nr)) buy_price_platinum(obj, shop_nr) = NULL; but I'm not sure if %d chokes on displaying NULL, and I really don't want to smell smoke coming out of the old '386 tonight... ******************************************************************************************* Well.. I should do something a little different.. show about and if that displays what you want if the price is 0 and the "normal" lines if is not.. (I'm a little lazy to post the code, but I think you got the idea, don't you?):wq
This archive was generated by hypermail 2b30 : 12/07/00 PST