ID:132863
Sep 5 2009, 1:37 am
|
|
It would be pretty nifty if you could get findtext to search backwards, I could simulate that myself by reversing the string but a built in feature would be nice :)
|
Sep 5 2009, 3:10 am
|
|
Wah? So you could search for "olleh" in "hello" and it would find it? Purpose?
|
In response to Falacy
|
|
Falacy wrote:
Wah? So you could search for "olleh" in "hello" and it would find it? Purpose? Not exactly. Here's an example, to get the extension name of a file I have to do this, currently: /* When with this new feature I could do this: proc See a benefit? |
In response to Haywire
|
|
Haywire wrote:
Here's an example, to get the extension name of a file I have to do this, currently: or you could just do one of these: copytext(FileName,findtext(FileName,"."),0) See a benefit? Not so much in that scenario =P |
In response to Falacy
|
|
Falacy wrote:
Haywire wrote: > copytext(String,findtext(String,"."),0) See a benefit? Firstly, an extension can be more than 3 characters and secondly a file name could consist of more than 1 dot, for example (lol.lol.lol.txt), with your method I would get (lol.lol.txt), I want (.txt) |
In response to Haywire
|
|
Since string manipulation isn't really one of BYOND's strong points, I don't think implementing this as a hard-coded solution would garner much gain.
|
In response to Metamorphman
|
|
If something isn't your strong point wouldn't you work on it?
That makes sense. |
In response to Haywire
|
|
This isn't going to make BYOND's string manipulation any faster as a whole, but it will make it easier to use. When I say string manipulation isn't a strong point, I mean that its not going to be so much of a gain when you can use a hard-coded method to gain what, like 0.01 second on the soft-coded method.
For a good feature, a mixture of efficiency, speed and ease of use are needed, and this feature isn't pretty light on 2/3 of those parts. |
In response to Haywire
|
|
You deleted the thing I was about to reply to <.< anyway:
proc/ReverseFindText(Whole,Part) |
In response to Falacy
|
|
Falacy wrote:
You deleted the thing I was about to reply to <.< anyway: > proc/ReverseFindText(Whole,Part) Yes, what about that? |
In response to Haywire
|
|
Haywire wrote:
Yes, what about that? There's your <s>reverse</s> backwards searching findtext() proc, shuffle along =P |
In response to Falacy
|
|
Falacy wrote:
Haywire wrote: That wasn't my point, yes, a soft-coded version could be implemented like you and I just did, I'm just asking for a hard-code version, it seems you are against this though :S |
In response to Haywire
|
|
Haywire wrote:
That wasn't my point, yes, a soft-coded version could be implemented like you and I just did, I'm just asking for a hard-code version, it seems you are against this though :S Meh, not really, just not really for it either =P Since as you said, we can easily make the procs ourselves, why bother having them do it? |
In response to Falacy
|
|
Falacy wrote:
Haywire wrote: A lot of features can be written ourselves, what's the point of them? I'll tell you, it's easier to do something, it's pretty much more convenient, this isn't a must-feature, but it'd be pretty cool to have it, simple. |
In response to Haywire
|
|
Haywire wrote:
A lot of features can be written ourselves, what's the point of them? Welp, I wrote one, just copy and paste it into your project and it'll do what theirs would, with no real effort from you =P And no, most features shouldn't be things we can do ourselves. Feature requests should be reserved for things that are either entirely impossible, or are so complicated/inefficient to do on our own that's its not even wroth the effort, but that would be simple (or at least simpler) for them to implement. They should also have a vast amount of practical uses, that would effect a large portion of the dev community, which this one would at least meet that requirement. |
In response to Haywire
|
|
Remember some files don't have an extension too :p
|
In response to Chowder
|
|
Chowder wrote:
Remember some files don't have an extension too :p if(findtext(fname, ".")) |
In response to Haywire
|
|
Err..Right, Good job o.o
|