Thank you KlausKlaus wrote: ↑Sun Nov 18, 2018 10:37 amOK, OK, let me put it this way, I think this is also what the dictionary means.
In a repeat for each loop like this:You can modify temp and do with it whatever you like, but the "container" (tFiles in this case) will NOT change in the end, means tFiles BEFORE the loop = tFiles AFTER the loop.Code: Select all
... repeat for each line temp in tFiles ## do whatever you want to with temp: delete char -4 to -1 of temp ## if temp was -> my_image.jpg ## then it now is in fact -> my_image end repeat ...
It is always difficult to explain something like this in your non-native language.
Delete part of text
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 90
- Joined: Sun Feb 15, 2015 2:51 pm
Re: Delete part of text
Re: Delete part of text
@Klaus.
Oh, that is what you meant. Well, sure.
@ Jacque.
I thought so. But you can indeed (at least these days) fool around with the index midstream. I will test HC tomorrow. I have a feeling my little handler will not like it there.
Craig
Oh, that is what you meant. Well, sure.

@ Jacque.
I thought so. But you can indeed (at least these days) fool around with the index midstream. I will test HC tomorrow. I have a feeling my little handler will not like it there.
Craig
Re: Delete part of text
just wonder a bit about this, deleting chars -1 to -4 in a filename, where the end could be something like mytext.lz would make it to mytex.
would it not be better to set itemdel to "." transfer item 1 to a new string, and then replace the original with the new string?
would also fix a problem on Unix like system where the filename could be something like mytext.tar.gz
maybe just me that is tired, or something I don't get, would not be the first time
would it not be better to set itemdel to "." transfer item 1 to a new string, and then replace the original with the new string?
would also fix a problem on Unix like system where the filename could be something like mytext.tar.gz
maybe just me that is tired, or something I don't get, would not be the first time
-
- Posts: 90
- Joined: Sun Feb 15, 2015 2:51 pm
Re: Delete part of text
You are right. The fact is that in this case I know exactly what I want to eliminate. It is always and only the last four letters of the file, the point and the extension, so it is a code that must do only that and only in this case with those files.hpsh wrote: ↑Mon Nov 19, 2018 4:51 amjust wonder a bit about this, deleting chars -1 to -4 in a filename, where the end could be something like mytext.lz would make it to mytex.
would it not be better to set itemdel to "." transfer item 1 to a new string, and then replace the original with the new string?
would also fix a problem on Unix like system where the filename could be something like mytext.tar.gz
maybe just me that is tired, or something I don't get, would not be the first time
Re: Delete part of text
@hpsh
Your thinking is correct; it is much more robust.
I have often chosen "the easy" way in a handler, thinking surely I did not need to deal with anything unexpected. Just as often, I had to go back and rework. Those unexpected things keep popping up.
Craig
Your thinking is correct; it is much more robust.
I have often chosen "the easy" way in a handler, thinking surely I did not need to deal with anything unexpected. Just as often, I had to go back and rework. Those unexpected things keep popping up.
Craig