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
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: Fri Jul 25, 2003 11:08 pm   

Write specific line to file
 
Suppose I ahve a file called item.txt, and it has the following

Name: a dagger
Wear: Take hold

Now, could I do the following.
#WRI 6 {this is record 3} 5, and end up with two blank lines after wear: take hold?

Also, is there a way to use a variable to create a new file and write to it?

Basically, I want to id an item, take the name into the ItemName variable, and then create a file named after the item name, replacing all spaces with _, so A Black Dagger would be a_black_dagger.txt?

Can anyone give me any insight to this?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jul 26, 2003 1:42 am   
 
For your first question, there's an easy answer. Try it and find out.

For the second, that also sounds pretty easy.
#TR {Name: (*)} {#VAR ItemName {%1};#FILE 7 {%replace( %1, " ", "_").txt}}
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