This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Print objects with grp.all
#1
Good morning to all
I have the following problem

I want to call all my objects and put them inside a variable, I already did it like this:



Code:
objects= grp.all();

log(objects);



but the result it gives me is not the one I want, since I have the following objects
0/0/1
... there are several of these
1/1/1
..... there are several of these

but I do not leave the others that are aprox 500 objects
How can I get 500 objects out?



a Img

Attached Files Thumbnail(s)
   
Reply
#2
Logs are limited to 8KB per entry, if you want to view the whole list you can create a .lp file and open it in your browser:
Code:
<pre>
<?
require('apps')
vprint(grp.all())
?>
</pre>
Reply
#3
Hi,

The result is the full table of objects only log shows you the first part of it.

You can see that the log is longer then showed by .. on the end of the printed log. 

If you want to log all items you have to iterate the table and log them item by item.

BR,

Erwin
Reply
#4
Hi Admin, your have reasom , I do not used .lp beacuse tried insert a data in my database local  using your example.

Hi Erwin

I used a loop of size 30 but only me print 10 values or datas for example:

Code:
a=30
for i=1,30,1 do
 log(i)
end

But it is when print by the function by default of the logic machine log()
now, if I have insert 500 objects, to my database local, it can?
Reply
#5
Code:
objects = grp.all()
for i, object in ipairs(objects) do
  log(object)
end
Reply


Forum Jump: