Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Table to string
#1
Hi.
How I'm able to convert a table into string, for print purposes.

For example 
local position = getCursorPosition();
[...]
print(position);
Reply
#2
print ("X: "+position.x+" "+"Y "+position.y);

[Image: 5483370700_1461400500.png]
Nie będzie mnie do sierpnia, jestem w Szkocji i zarabiam na studia. Do zobaczenia.
Reply
#3
So... is the converting possible? Big Grin I know this way, but a convert will be more useful for me.
Reply
#4
local pos = getCursorPosition();
print(pos.x + " " + pos.y);

No more options
Reply
#5
Convert? For draws?


local position = getCursorPosition();
local posx= position.x.tostring();
local posy= position.y.tostring();
(tointeger(), tochar() ....)
print(posx +" "+ posy);
Nie będzie mnie do sierpnia, jestem w Szkocji i zarabiam na studia. Do zobaczenia.
Reply
#6
I think this isn't what he is looking for. There are times when you need your table as a string, for saving it to a file for example while keeping the file readable. You can write your own method for this, I don't think Squirrel has one you can use. That being said, I have posted something for you over here: http://gothic-online.com.pl/forum/showth...p?tid=1427

The converted strings look like this and can be converted back: {y{5090.97}x{47532.7}z{20632.1}angle{333.455}}
Hopefully that's what you are searching for.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)