write to logfile # <Var/Number> append =<Var/Number> prinf: pageid =<Var/Number> text

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

write to logfile # <Var/Number> append =<Var/Number> prinf: pageid =<Var/Number> text

Post by mark_a_condren » Mon, 20. Sep 10, 13:40

write to logfile # <Var/Number> append = <Var/Number> printf: pageid = <Var/Number> textid = <Var/Number>, <Value1>, <Value2>, <Value3>, <Value4>, <Value5>


<Var/Number> = The log file number that will be written to. If this does not exsist it will be created.
<Var/Number> = Set this value to [TRUE] / [FALSE], or their numerical equivalent of (1) / (0) respectivly. Or, a variable containing one of these values.
pageid= <Var/Number> = This is the page number of the XML file. You can enter this number directly in or via a variable, but in both cases it must be an integer.
textid= <Var/Number> = This is the text id number for the required entry in the XML file. You can enter this number directly in or via a variable, but in both cases it must be an integer.
<Value1 - 5> = What is to be inserted into the sprintf string located at textid = <Var/Number>.


Formats and writes text to an external file.
See write to logfile and sprintf for more information on the log file and the formatting respectively.

If logfile # = null, nothing at all will be written. This can be useful for debugging.

If append is [TRUE], then the value is added to the end of the log file.
If append is [FALSE], then the contents of the log file are replaced with <Value>.


Example:

The following might be used at the start of a 'Debug' log.

$playing.time = playing time
$fmt.playing.time = format time: $playing.time
write to logfile # 9999 append =[TRUE] printf: pageid = 9999 textid = 100, $fmt.playing.time, null, null, null, null

This could add something like the following message to the log file, 'Debug started at playing time = 12:34:56'. It would be 'added' due to 'append =[TRUE]'.


Command Location:
  • »» Logbook Commands
    • write to logfile #<Var/Number> append=<Var/Number> printf: pageid=<Var/Number> textid=<Var/Number>, <Value>, <Value>, <Value>, <Value>, <Value>

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24969
Joined: Sun, 2. Apr 06, 16:38
x4

[TiP][49] 287274

Post by X2-Illuminatus » Sun, 17. Oct 10, 21:57

write to logfile # <Var/Number> append = <Var/Number> printf: pageid = <Var/Number> textid = <Var/Number>, <Value1>, <Value2>, <Value3>, <Value4>, <Value5>


<Var/Number> = Die Nummer der Log-Datei, in die geschrieben werden soll. Falls sie nicht existiert, wird sie erstellt.
<Var/Number> = Setze dies auf [TRUE] (wahr) / [FALSE] (falsch), oder auf ihre numerischen Äquivalente (1) / (0). Oder auf eine Variable, die einen dieser Werte enthält.
pageid= <Var/Number> = Dies ist die Seitenzahl der XML-Datei. Du kannst diese Zahl direkt oder über eine Variable eingeben, aber in beiden Fällen muss es eine ganze Zahl sein.
textid= <Var/Number> = Dies ist die Text id Zahl für den benötigten Eintrag in der XML-Datei. Du kannst diese Zahl direkt oder über eine Variable eingeben, aber in beiden Fällen muss es eine ganze Zahl sein
<Value1 - 5> = Was in die sprintf Zeichenkette an der textid = <Var/Number> eingegeben werden soll.


Formatiert und schreibt Text in eine externe Datei.
Siehe write to logfile und sprintf für mehr Informationen über die Logdatei sowie deren Formatierung.

Wenn logfile # = null, wird überhaupt nichts geschrieben. Dies kann zum 'Debuggen' nützlich sein.

Wenn append [TRUE] ist, wird der Wert ans Ende der Log-Datei geschrieben.
Wenn append [FALSE] ist, wird der Inhalt der Log-Datei mit <Value> ersetzt.


Beispiel:

Das folgende wird möglicherweise am Anfang eines "Debug"-Logs genutzt:

$playing.time = playing time
$fmt.playing.time = format time: $playing.time
write to logfile # 9999 append =[TRUE] printf: pageid = 9999 textid = 100, $fmt.playing.time, null, null, null, null

Dies würde die folgende Nachricht in die Log-Datei schreiben: 'Debug started at playing time = 12:34:56'. Es würde aufgrund von 'append =[TRUE]' hinzugefügt werden.


Zu finden unter:
  • »» Logbook Commands
    • write to logfile #<Var/Number> append=<Var/Number> printf: pageid=<Var/Number> textid=<Var/Number>, <Value>, <Value>, <Value>, <Value>, <Value>

Return to “MSCI Reference”