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
rehevkor
Newbie


Joined: 02 Nov 2006
Posts: 9

PostPosted: Sat Dec 09, 2006 6:15 am   

Using #SUB with spaces at the start.
 
Okay, I have a trigger that uses a #SUB, and I want it to mimic the original line exactly, however I can't figure out how to add spaces to the beginning of the created line.

The sub I'm using is:
#SUB { %1 for %2,%3,%4,%5Gd %6 $%format(&-.2n,@CAMD)}
(not the 3 spaces at the start)

The original line is:
The following items are for sale:
A: a golden ball for 2,5,0,0Gd (one left).
B: an Allidin's lamp for 6,6,6,66Gd (one left).
C: magic hand mirror for 1,0,0,0Gd (one left).

This is how it appears:
The following items are for sale:
A: a golden ball for 2,5,0,0Gd (one left). $187.50
B: an Allidin's lamp for 6,6,6,66Gd (one left). $499.99
C: magic hand mirror for 1,0,0,0Gd (one left). $75.00

This is how I want it to look:
The following items are for sale:
A: a golden ball for 2,5,0,0Gd (one left). $187.50
B: an Allidin's lamp for 6,6,6,66Gd (one left). $499.99
C: magic hand mirror for 1,0,0,0Gd (one left). $75.00

Any ideas?
Reply with quote
jroper73
Novice


Joined: 03 Aug 2006
Posts: 30

PostPosted: Sat Dec 09, 2006 9:10 am   Re: #sub with spaces
 
Have you tried an anchore?

{^ %1...

Just an idea

Asbestos
ncmud.org 9000
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Sat Dec 09, 2006 9:41 am   
 
try

#sub {%char(32)...}

or

#sub {%repeat(" ",3)...}
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Dec 09, 2006 12:59 pm   
 
Or just this:

#sub {" "%1 and so on}

The "" will make the spaces a string, and hopefully sure that they aren't eaten by the parser.

EDIT: Oh dear, the forums ate two of my spaces. You get the idea anyway.
Reply with quote
rehevkor
Newbie


Joined: 02 Nov 2006
Posts: 9

PostPosted: Mon Dec 11, 2006 12:54 am   
 
%repeat(" ",3) worked great, thanks guys. :P
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