String Variable
|
05-30-2017, 05:08 PM
(This post was last modified: 05-30-2017 05:09 PM by KeithB.)
Post: #1
|
|||
|
|||
String Variable
What should I use for a string variable?
Let me ask my real question: I am putting some text on the screen using TEXTOUT() and since the string might be variable length it sometimes leaves junk even if I write the background color. What is the accepted way to fix this? re-write the original screen with the bg color? send a bunch of spaces? Also, is there any clever way to get the screen back if I call INPUT()? |
|||
05-31-2017, 03:49 AM
Post: #2
|
|||
|
|||
RE: String Variable
(05-30-2017 05:08 PM)KeithB Wrote: What should I use for a string variable? Bonjour Vous pouvez utiliser var:=TEXTOUT_P("message",x,y...) pour connaître la coordonnée x de fin d'affichage, ensuite moi je ferai un RECT_P(x,y1,var,y2....) Pour INPUT vous pouvez utiliser BLIT_P(Gx,G0) puis BLIT_P(G0,Gx) ou Afiles("nom"):=G0 puis G0:=Afiles("nom"). Espérant vous être utile. Hello You can use : var: = TEXTOUT_P ("message", x, y ...) to know the end x display x coordinate, then me I will do a RECT_P (x, y1, var, y2 ....) For INPUT you can use BLIT_P (Gx, G0) then BLIT_P (G0, Gx) or Afiles ("name"): = G0 then G0: = Afiles ("name"). Hoping to be useful. Sorry for my english |
|||
05-31-2017, 02:43 PM
Post: #3
|
|||
|
|||
RE: String Variable
Thanks - I got the gist, good idea!
|
|||
06-01-2017, 03:57 AM
Post: #4
|
|||
|
|||
RE: String Variable
Use RECT or RECT_P to erase the block you wish to "write" and then "write" using TEXTOUT (or TEXTOUT_P). As Tyann suggested, you can also use the output of the TEXTOUT command (which returns the x-coordinate of the "end" of the message string that got printed) to erase, via RECT, to the end of the screen.
I think the best way is to draw in a separate buffer (say G1) by first erasing the row with RECT_P(G1,x1,y1,x2,y2) and then using BLIT_P(G1). Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)