Jump to content
IGNORED

String Concatenation


toddtmw

Recommended Posts

Okay. I know I’ve programmed in many many (too many to count) languages since my Atari days, but I simply do not recall how poorly Atari concatenates strings. Is there really no

A$=B$+C$

type functionality in Atari basic?

 

Is the “best” approach really this clunky?:

A$=B$
A$(LEN(A$+1)=C$

 

I do do not recall having to code this “badly” BITD...

Link to comment
Share on other sites

Atari basic is a bit clunky with strings, although I believe Microsoft Basic can deal with addition of strings (never used it so can't confirm personally)

 

I've just started using FastBasic and would highly recommend it, although it still has the same problem with normal strings.  However, you can have variable strings with a max length of 255 which you can perform operations on.

Edited by Preppie
Link to comment
Share on other sites

Hi!

On 7/13/2019 at 12:33 PM, Preppie said:

Atari basic is a bit clunky with strings, although I believe Microsoft Basic can deal with addition of strings (never used it so can't confirm personally)

 

I've just started using FastBasic and would highly recommend it, although it still has the same problem with normal strings.  However, you can have variable strings with a max length of 255 which you can perform operations on.

On FastBasic, you can do  A$ =+ B$  to copy B$ at the end of A$. I did not implement the easier to read " A$ = A$ + B$ " because it would need a temporary string (being slower), and normally you need just to concatenate and not to create an arbitrary string.

 

Have fun!

 

  • Like 4
Link to comment
Share on other sites

  • 1 month later...

Toddtmw,

Perhaps back in the day you did something like this (assuming your string was large enough to support it and you already knew how long A$ was):

A$(x,x)=B$, where X is the index of the last character in A$. Doesn't seem so clunky to me. Just requires more direct knowledge of how your strings are configured.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...