<RetVar/IF> = read text: page id = <Var/Number>, from <Var/Number> to <Var/Number> to

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

Moderators: Scripting / Modding Moderators, MSCI Moderators

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

<RetVar/IF> = read text: page id = <Var/Number>, from <Var/Number> to <Var/Number> to

Post by mark_a_condren » Thu, 9. Sep 10, 14:46

[skip|else] if [not]|while [not]| <RetVar/IF> = read text: page id = <Var/Number>, from <Var/Number> to <Var/Number> to array, include empty = <Var/Boolean>


[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Command return, with an 'if' statement used it will be TRUE (1) if condition passes or FALSE (0) if it fails, otherwise if you use a Variable it will be the PID as an integer.
<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.
<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.
<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.
<Var/Boolean> = Enter TRUE / FALSE to including empty text id's into the array. A text id must be defined but have no text entered into it for this to work, non defined entries will be skipped regardless.


Returns <RetVar/IF> an array of text entries that have been read in from an external xml text language file, page id = <Var/Number>.
All text entries beginning with the first, from = <Var/Number> and ending with, to = <Var/Number> will be read and stored in the array. The include empty condition <Var/Boolean> allows you to specify if empty entries in the text file should also be read to the array.


Example:

$text.array = read text: page id = 9999, from 100 to 200 to array, include empty = TRUE
$ret open custom menu: title = 'List' description = 'Select from Array List' option array = $text.array

This would display a list of all the entries from the text file in the menu and because of the 'include empty = TRUE' would also include blank lines. The handy thing to remember about this is that the menu still gives a return of the array index of the entry selected. So the return could be gotten using $selection = $menu [$ret].


Command Location:
  • »» General Commands
    <RetVar/IF> = read text: page id = <Var/Number>, from <Var/Number> to <Var/Number> to array, include empty = <Var/Boolean>

Locked

Return to “MSCI Reference”