Thanks!
John Balgenorth
On Sep 30, 2014, at 4:12 PM, Bob Sneidar wrote:
> Use repeat with i - 1 to the number of characters of myString step 3
>
> Bob S
>
>
> On Sep 27, 2014, at 24:23 , JB wrote:
>
>> Another thing to consider is the characters are
>> not in any specific crder. It could
Use repeat with i - 1 to the number of characters of myString step 3
Bob S
On Sep 27, 2014, at 24:23 , JB wrote:
> Another thing to consider is the characters are
> not in any specific crder. It could be cfacded or
> anything else.
>
> If is use a repeat for each char and the variable
> as a
Instead of my goofy repeat command
your replace can be modified to some
thing like the code below.
command replace_maybe @rString
repeat with i = 58 to length( rString ) step 58
put return after char i of rString
end repeat
end replace_maybe
But the problem is similar to what m
The code I posted is not accurate.
For one thing it should have been
put 71 into i
because the return will make the
72 char in the line.
Another problem is it does not end
with the last line being 72 chars or
less. Anyway this is a start to the fix.
John Balgenorth
On Sep 28, 2014, at 3:44 PM,
Hi Dick,
I found the char was getting off by 1 each line
because of the EOL returns. Here is a regex
to strip the EOL returns.
put replacetext(theData,"[\0\cM\r\f\n]","") into theData
and then here is some code to put the EOL returns back.
put theData into tString
--put fld id 1022
Hi Dick,
That is really nice! Thank you.
It works great.
John Balgenorth
On Sep 27, 2014, at 1:49 AM, Dick Kriesel wrote:
> On Sep 27, 2014, at 12:23 AM, JB wrote:
>
>> But there might be a faster way.
>
> Hi, John.
>
> Here's a way that works in under a millisecond on my iMac, and a way
On Sep 27, 2014, at 12:23 AM, JB wrote:
> But there might be a faster way.
Hi, John.
Here's a way that works in under a millisecond on my iMac, and a way to test
its speed.
command replace_maybe @rString
repeat with i = 3 to length( rString ) step 3
if char i of rString is "D" the
Another thing to consider is the characters are
not in any specific crder. It could be cfacded or
anything else.
If is use a repeat for each char and the variable
as a counter that resets every three times then
I only need to make one pass through to make
the changes. But there might be a faster
Thanks, Kay!
The problem is there are no delimiters. It
is a string of only chars A to F and there
are no spaces etc.
John Balgenorth
On Sep 26, 2014, at 11:19 PM, Kay C Lan wrote:
> Assuming tBigList contains your data and it is a tab separated list.
>
> set the itemDelimiter to tab
> repe
Assuming tBigList contains your data and it is a tab separated list.
set the itemDelimiter to tab
repeat for each item tSearchThis in tBigList
if (char 3 of tSearchThis = "D") then
put "+" into char 3 of tSearchThis
end if
put tSearchThis & tab after tNewList
end repeat
--remove the trailing ta
Thank you for the info. I knew someone
who knew everything once but with the
rapid pace of change in technology it
became impossible for him to keep up
and everyday he ended up knowing a
little bit less.
John Balgenorth
On Sep 26, 2014, at 9:50 PM,
wrote:
> My experience is that when doing
My experience is that when doing string searching offset() is by far the
fastest way.
But I don't know everything.
Larry
- Original Message -
From: "JB"
To: "How to use LiveCode"
Sent: Friday, September 26, 2014 10:26 PM
Subject: Replacing Characters
I want to replace every third
12 matches
Mail list logo