Announcement

Collapse
No announcement yet.

Printing and working with strings problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printing and working with strings problem



    Why have I to change txt_width, txt_height and txt_Bold everytime I make a print?
    It seems that the caracter configuration is used only for the first time I make a print().

    I´m using Goldelox.

    e.g.
    Code:
    for(ii:=0;ii<=2;ii++)           //linhasfor(i:=0;i<=colmax;i++)     //colunasch:=msg[i+(ii*colmax)];txt_Width(1); txt_Height(2);txt_Bold(ON);txt_MoveCursor(lininit+ii,colinit+i);print([CHR]ch);nextnext

    Another thing:

    *Is there another way to automaticaly wrap the content printed using print() function when the text reaches the end of the screen?(I mean reach the last column, at right)

    I have the folowing code:

    Code:
    var msg[100];txt_Width(1); txt_Height(2);txt_Bold(ON);txt_MoveCursor(2,0);msg[0]:='E'; msg[1]:='d'; msg[2]:='u'; msg[0]:='\0';print([STR]msg[0]);  //this printing not works. Why?  What´s wrong?//I think that for text I need a byte array in ram(not a word array). How to do this?
    Thank you a lot!
    Eduardo









  • #2


    The text attributes are automatically reset at the end of the print statement.
    This saves you having to turn things off after you use them.

    allArrays are words, so if you want to load an array with text, there are 2 ways to do this.

    Simplest way is to use the 'to' function,
    eg

    to(message); putstr("Hello"); // could also use print here

    print([STR] message);

    Alternatively, you must pack the lo and high order bytes separately,

    there is a good example here :-

    http://www.4dsystems.com.au/code/index.php?node=20&id=37
    Regards,
    Dave

    Comment


    • #3


      but, is it possible to wrap(at the end of the screen) automaticaly a text string printed with "print()"?




      Another thing: In that example you gave-me, two chars are placed each time inside array. But I want to put just one char each time inside the array. How to do this?




      Thanks again!

      Comment

      Working...
      X