Jump to content

Neue Beta-Version V5


Neo

Empfohlene Beiträge

Hi goetz,

Thank you for your help and it works fine now...  except that the table "liste", even if correctly filled by the event, appears empty if I open the script where it is defined.  I suppose that this is because the table is dynamic, howver its content is available in another event.

So my question now is : how to keep the content of the table "liste" when I save and close the layout.  My objective is trying to build (more or less automatically) a table containing the itinerary of a specific train.

Could you help me?

regards

André

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 17 Minuten schrieb ademes:

So my question now is : how to keep the content of the table "liste" when I save and close the layout.

Best answer: Wait for the next update, which is coming soon. It will offer two new data types for object variables and module variables:

lists and tables (difference being, that lists have consecutive numbers as cell indexes, whereas tables have named cells)
It even allows for nested lists and tables in any combination. You may for instance list all your waggons by storing a table for each waggon (name, cargo, destination ...) inside your list of waggons.

 

Alternative: (not recommended, but available now): convert your table contents into one long string and store that as text in one of your object/module variables. You'll need to write your own parser to convert it all back into a table.

Do you know that you can (already) use any vehicle you know (say: the one that just triggered a contact) to ask the event manager for a list of all vehicles in the same train?

Bearbeitet von Goetz
Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 1 Minute schrieb ademes:

Is using external files (Lua files) another alternative?

No, that's never a good idea.

Your problem would be to keep your layout and the external data in sync. If you let your layout run for a while, all sorts of data will change and be entered into the external file. If at the end of your session you leave the MBS without saving your layout, the data in your external file no longer matches the state of your unchanged layout.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hallo @Neo,
ich hätte da noch einen üblen Verklicker zu melden:
Wenn man auf's Mausrad drückt und die Sicht dreht und dann der Finger auf der rechten Maustaste zuckt, dann hat man gelitten.
Er übernimmt die Drehung als Mausbewegungsfunktion (auch ohne jeden Tastendruck nun) und da kommt man nicht mehr raus. Jedenfalls weiß ich nicht wie.

Gruß
  Andy

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 51 Minuten schrieb Andy:

und da kommt man nicht mehr raus.

Das Fehlverhalten, welches du beschreibst, kann ich hier nicht nachstellen.

Egal, wie ich bei gedrücktem Mausrad auf die rechte Maustaste klicke - beide Tasten behalten ihre vorherige Funktion bei. Ich kann anschließend (nachdem ich alle Tasten losgelassen habe) wieder wahlweise das Mausrad drücken, um zu drehen oder die rechte Maustaste drücken, um die Anlage zu verschieben.

 

Bearbeitet von Goetz
Link zu diesem Kommentar
Auf anderen Seiten teilen

Moin Götz,
also, während der Rotation (linker Finger drückt Mausrad!) - rechter Finger zuckt, dabei geht das Kontextmenü auf. Du läßt erstmal alles los!
Klickst Du nun außerhalb des Kontextmenüs mit der linken Taste - das Mausrad ist inzwischen frei - dann passiert's. Bei mir absolut reproduzierbar.

Gruß
  Andy

Bearbeitet von Andy
Link zu diesem Kommentar
Auf anderen Seiten teilen

 
 
 
 
vor 3 Stunden schrieb Andy:

 Ich glaub' ich werd' alt. 9_9

 

frühstückende Grüße
  Andy

Moin moin

Also ich haette einen tip fuer schnelleres altern: Pass wegschmeissen und alter schaetzen lassen:P

Koennte ja zum sofortigen renten eintritt fuehren. Jetzt wo drueber nach sinniert wird das eintrittsalter noch weiter anzuheben, ein nicht zu verachtender vorteil, gell.:)

Cheers

Tom

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hi @Neo

Irgendwas ist mit der forumsseite. Es haeufte sich nun so etwa die letzten 3-4mal wo ich einen anderen beitrag zitierte, so wie gerade Andy's, und dabei unrelevantes aus dem zitat loesche, um den gesammten beitrag nicht unnoetig lang werden zu lassen. Frueher kein problem passiert nun folgendes: Der raum den die geloeschten zeilen eingenommen hatten wird, wie bei Andy's zitierung nun mit dem balken am anfang geschmueckt und ich kann den beitrag weder bearbeiten noch zitieren. Dachte erst das es vielleicht mein browser sein koennte, abba wenn ich es vom handy aus versuche geht auch nix. Ungekuerzte beitraege mit zitaten und einfache beitraege lassen sich zitieren und bearbeiten.:/

Cheers

Tom

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 4 Stunden schrieb metallix:

 Frueher kein problem passiert nun folgendes: Der raum den die geloeschten zeilen eingenommen hatten wird, wie bei Andy's zitierung nun mit dem balken am anfang geschmueckt und ich kann den beitrag weder bearbeiten noch zitieren.

Mit Firefox zitiert und partiell gelöscht. No problem.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello,

I have a problem with "Function" :

I call a function with the Following arguments : setgrill (grill, listgrill, train, return_code) where "grill" and "setgrill" are tables, Train is the object "vehicle" and return_code is a variable number set to 0 when Calling the function.
Inside the function, return_code will be set to 0 if OK and to 4 if KO.  But when I test the value of return_code after the call to the function, its value is always 0 even if the function set it to 4.
I've inserted the instruction "return return_code" at the end of the function, but it seems that the caller continue to test the "local" return_code.

My question is : how to define the argument return_code to be valid either in the caller and in the function.  Setting it as a global variable is not a solution as the function may be called by different caller at the same time.

Thank you 

André

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello,

In addition to my previous message, it seems that the function "return" doesn't run properly Under MBS.

The Following should return a value for n :
function foo(n)
  print ("function foo")
  return n*2
end

foo(4)  
print ("N = ", n) should return N = 8, but it returns nothing (N =   )

Regards

André

Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen.

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...