Da das lua print in S6 ja keine Funktion mehr hat, habe ich es mir für meine Zwecke gekapert, heraus kam ein kleines Testwerkzeug, um zum Beispiel zu prüfen was für Werte eine Funktion zurückgibt.
(Ausserdem ist es kürzer als Logic.DEBUG_AddNote und wird im Notepad++ farblich hervorgehoben)
Anwendung: Man kann ALLES in beliebiger Anzahl übergeben.Code:function print(...) local arg = { ... } if #arg > 1 then Logic.DEBUG_AddNote(#arg .. " values") end local String = arg[1] local t = type(String) String = (t == "table" and t .. " " .. #String) or (t == "function" and t) or (t == "nil" and t) or (t == "boolean" and (t .. (_String and " true" or " false"))) or (tostring(String) and String) or "Type Unsupported" Logic.DEBUG_AddNote(String) end
Also:
print("text")
--text
print(14)
--14
print(Entities)
--table 0 (0 weil Entities ein lexikalisches Table ist)
print({1,3,6})
--table 3 (3: Die Anzahl der Einträge bei nummernindizierten Tables)
print(true)
--boolean true
print()
--nil
print(nil)
--nil
print(Logic.GetEntityPosition(Logic.GetStoreHouse( 1)))
--2 values
--(hier dann die x-Koordinate)
Bei mehreren Rückgabewerten erhält man also darüber einen Hinweis, und auch wieviele es sind.
Ich hoffe es gefällt euch
Britta





LinkBack URL
Über LinkBacks
Zitieren






Lesezeichen