Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
erazmus
Beginner


Joined: 05 Apr 2004
Posts: 11
Location: New Zealand

PostPosted: Wed Apr 28, 2004 12:45 pm   

Basic DB use.
 
Hi all,

I'm not having much luck figuring out how I compare certain fields of 2 records that are in different views of my eq DB.

I have been trying to use %viewrec but I don't think this is the way to go...

I get the following output after entering the following -
#show %viewrec(0,Worn,true) produces
Num17.dKeywordZedKindCombat, LevelLocationFloatingInvisibleFalseCursedFalseNo DropTrueWornTrueTrigger^You release the stone of Zed and it starts orbiting your head.

and

#show %viewrec(0,Heal,true) produces
Num33.dKeywordGlowingKindHealLocationFloatingInvisibleFalseCursedFalseNo DropFalseWornFalseTrigger^You release a glowing purple stone and it starts orbiting your head.

How do I easily compare specific fields of these records in different views?

eg.
#if (%viewrec(0,Heal,true).Worn) {#ECHO xxAlreadyWornxx} {oldEq = %viewrec(0,Worn,true).Keyword;remove @oldEq; put @oldEq sack; wear %viewrec(0,Heal,true).Keyword}

I know the example doesn't work that way but can't figure from the many DB functions how I would do this.
Some advice please?

Cheers,
Erazmus.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 28, 2004 5:05 pm   
 
Use the %db function itself instead of the record.key shortcut for it.

#IF (%db( %viewrec( 0, Heal), Worn)) {#ECHO xxAlreadyWornxx} {oldEq = %db( %viewrec( 0, Worn), Keyword);remove @oldEq;put @oldEq sack;wear %db( %viewrec( 0, Heal), Keyword)}
Reply with quote
erazmus
Beginner


Joined: 05 Apr 2004
Posts: 11
Location: New Zealand

PostPosted: Wed Apr 28, 2004 9:56 pm   
 
Thanks I will give this a go :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net