Clan Hopper

dawdawdo

Member
Well, I made a first attempt at this. I think I need a little debugging help though:

I grabbed the form for switching clans from clan_signup.php and I want to change it slightly so that it has a name I can access with javascript. The problem is that while contains_text() finds the string I want to replace, I can't get replace_string() to actually do the replacement. Usually more eyeballs = faster debugging, so I thought I'd let everyone look at what I have so far. Thanks.

EDIT: I converted the string to a buffer and it worked. Is the replace_string function only good for buffers?
 

Attachments

  • clanhop.ash
    799 bytes · Views: 42
Last edited:

jasonharper

Developer
ASH strings are immutable; it's not possible for replace_string() to modify the string in place as you seem to be expecting. Instead, it returns a buffer containing the modified text (and as a buffer, it's more suitable for any further modifications you want to make to the text).

When passed a buffer, replace_string() does the modification in place, and returns the same buffer.
 
Top