Hi all,
Can someone point me to the spot in the wiki where it discusses appending text to the END of a string? I think that this is new with either 4.18 or 4.2, and I THOUGHT I saw it in the wiki at one point, but no search seems to take me there (I tried "assignment statements" and "LET", but that didn't help.)
I thought it was something like LET A$(X:0)="MORE STUFF". The 'zero" seemed significant, but I can't figure out the proper syntax. I see that let A$(0:0) will "pre-pend" the text to the beginning of the string, moving everything else over.
-- Susan
Appending text to a string
Moderators: Susan Smith, admin, Gabriel
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
interestingly enough I did a few speed test with the different methods over 99,000,000 cycles and the method:
x$(inf:0)='text to append'
and
x$(32767:0)='text to append'
we're exactly the same speed (2 minutes,4 seconds).
while
x$(inf:inf)='text to append'
was only slightly slower (2 min,7 seconds)
They're all good. Luis says that (32767:0) is more backwards compatible with older versions of BR!/WB.
I added the inf methods to the Append page on the wiki for future reference.
-John B.
x$(inf:0)='text to append'
and
x$(32767:0)='text to append'
we're exactly the same speed (2 minutes,4 seconds).
while
x$(inf:inf)='text to append'
was only slightly slower (2 min,7 seconds)
They're all good. Luis says that (32767:0) is more backwards compatible with older versions of BR!/WB.
I added the inf methods to the Append page on the wiki for future reference.
-John B.
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
Thanks for adding this to the wiki John. But we might want to put a link to it on the "assignment" page. At the time I was searching, I didn't think of the terms PREPEND or APPEND. Perhaps some others wouldn't either. I was thinking that the LET statement (which has it's own page) was the most logical place for a reference to the append/prepend page.
I added a "See also: [[Append]]" to the "Let" page... "Assignment" currently isn't a page, but it should probably be a redirect to somewhere... you think to "Assignment Statements"? And do you think that that the "Append" page should be a member of the "category:Assignment Statements"? Currently I have only actual statements as members of that category and "Append" isn't a statement, it's currently a member of the categories "Basics" and "Terminology".
-John
-John
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California