Jump to content
Zum Start hinzufügen

Weitere Informationen

3D-Modellbahn Studio

Eine Vollbild-App auf Ihrem Startbildschirm mit Push-Benachrichtigungen und mehr.

So installieren Sie diese App auf iOS und iPadOS
  1. Tippen Sie auf das Teilen-Symbol in Safari
  2. Scrollen Sie durch das Menü und tippen Sie auf Zum Startbildschirm hinzufügen.
  3. Tippen Sie oben rechts auf Hinzufügen.
So installieren Sie diese App auf Android
  1. Tippen Sie auf das 3-Punkte-Menü (⋮) in der oberen rechten Ecke des Browsers.
  2. Tippen Sie auf Zum Startbildschirm hinzufügen oder App installieren.
  3. Bestätigen Sie durch Tippen auf Installieren.

Empfohlene Beiträge

Geschrieben

Hello, 

Maybe a more special question, but here we go.

Just to see if I have a good understanding wich t comes out here :

local t = layout:getVehiclesOn(signal)  gives a table  t with the vehicles on that track contact. ( 1 item or none )
local t = layout:getVehiclesOn($("LongTrack")) gives a table t with the vehicles on that track


I want to know if there is a vehicle an the contact of the signal.
In previous tests I used # for the number of items in a table.
  if #t ~= 0 then  ( there is a vehicle on the signal , a wagon or a loc )

So far so good, my problem is solved.

But t is a table, the test
if t ~= {}  an empty table  failed, why  ?

Some help is welcome.

Kind regards,

Herman 

 

 

Geschrieben

Those are only references to tables. 

You are comparing two different references. 

You could check the NEXT Operator for that. But i am not sure that works. Remember there are different kinds of members in a table. 

Geschrieben
  • Autor

Hello @HaNNoveraNer

You  "Those are only references to tables".  

A reference to the memory ( like a pointer ) I agree with you. 
Thanks for your answer !

Greetings, have a nice weekend.

Herman (BE)

Geschrieben
vor 7 Minuten schrieb Herman:

like a pointer

exactly.
t and {} are two different tables.
You want to know, if both have the same property (i.e. the same number of entries),
but with t == {} you're asking if both are the same table.

 

Geschrieben
  • Autor

Hello Götz and Thomas,

With "only references to" from Thomas I understood that I was comparing two different things.

Thanks to both ! 

Nice regards,
Herman

 

 

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Push-Benachrichtigungen konfigurieren

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.