This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

String strang strung

He guys,
just took a look at my little codefragment

        text[5]=' ';
        text[6]='k';
        text[7]='g';


How to put this in one single line?
for example

//This does'nt works!
         text[5 to 7]=" kg";


Sorry for this stupid question, i guess there is a solution, but i was interrested in another idea than mine :-)

Parents
  • Hello Andy,
    thanks for your answer, but the blame on me.
    Yes your are right, i should spend some more time with a 'C' text book.
    I wrote this rubish

    //This does'nt works!
             text[5 to 7]=" kg";
    


    to give someone just an idea, what i'am looking for.

    Now i explored

            strcpy(&text[5]," kg");
    


    Seemed to work well.
    Just a hint to other users, a chr$(0) is appended after the "g". So take another look to be sure that you have declared the string long enough.

Reply
  • Hello Andy,
    thanks for your answer, but the blame on me.
    Yes your are right, i should spend some more time with a 'C' text book.
    I wrote this rubish

    //This does'nt works!
             text[5 to 7]=" kg";
    


    to give someone just an idea, what i'am looking for.

    Now i explored

            strcpy(&text[5]," kg");
    


    Seemed to work well.
    Just a hint to other users, a chr$(0) is appended after the "g". So take another look to be sure that you have declared the string long enough.

Children
No data