Difference between revisions of "Emuera/exetc"

From Era Wiki
Jump to: navigation, search
m (translated one line)
(Translated half the page)
Line 1: Line 1:
== 行末コメント ==
+
== End of line comment ==
  
A = B ;AにBを代入
+
A = B ;Substitute A for B
  
このように行の末尾にコメントを挿入できます</br>
+
You can insert a comment at the end of a line in this way.</br>
ただし、一部例外があり、「PRINT」命令のように引数が単純文字列の命令の場合にはコメント化されず文字列の一部と評価されます
+
However, there are some exceptions, and if the argument is a simple string instruction such as the “PRINT” instruction, it will be evaluated as part of the string without commenting
  
PRINT foobar;ほげほげ
+
PRINT foo;bar
  
この場合、「foobar;ほげほげ」がPRINTされます
+
In this case, "foo;bar" is PRINTed.
  
== 行の連結 ==
+
== Concatenate Rows ==
  
{
+
{
DIM CONST HOGE =
+
DIM CONST HOGE =
1,2,3,4
+
1,2,3,4
}
+
}
  
と書くと「#DIM CONST HOGE = 1,2,3,4」と解釈されます</br>
+
Will be interpreted as "#DIM CONST HOGE = 1,2,3,4"</br>
'{''}'の行にはホワイトスペース以外の他の文字が存在してはなりません</br>
+
'{' and '}' lines must not contain any other characters besides white space.</br>
改行記号のある位置には半角スペースが補われます</br>
+
One-byte space is added at the position where there is a line feed symbol.</br>
つまり関数名・変数名の途中で行を分割することはできないほか、</br>
+
In other words, lines cannot be split in the middle of function names and variable names,</br>
PRINTなどを分割すると表示文字列の中に改行だった半角スペースが含まれます</br>
+
If you divide PRINT etc., the display character string will include the half-width space that was a line feed</br>
Emueraの文法解釈において行連結処理はコメントの解釈より先に行われます</br>
+
In Emuera's grammatical interpretation, line continuation processing is performed before interpretation of comments.</br>
つまり
+
In other words
  
{
+
{
#DIM CONST HOGE =
+
#DIM CONST HOGE =
1,2,3,4 ;コメント
+
1,2,3,4 ;comment
,5,6,7,8
+
,5,6,7,8
}
+
}
  
は「#DIM CONST HOGE = 1,2,3,4 ;コメント ,5,6,7,8」となり、</br>
+
Becomes "#DIM CONST HOGE = 1,2,3,4 ;comment ,5,6,7,8",</br>
,5,6,7,8」は行末コメントの一部とみなされ無視されます
+
",5,6,7,8" is considered part of the end-of-line comment and ignored.
  
== 特別なコメント行 ==
+
== Special Comment Line ==
 
=== ;!; ===
 
=== ;!; ===
Emuera、eramakerのいずれでも、;で始まる行はコメント行とみなされますが、Emueraは;!;で始まる行はコメントではなく有効な行とみなします。</br>
+
In both Emuera and eramaker, lines starting with ; are considered comment lines, but Emuera considers lines starting with ;!; To be valid lines, not comments.</br>
eramakerでは実行してほしくない文を記述する際に使ってください。</br>
+
Use this when writing statements that you do not want eramaker to execute.</br>
例えば@SHOWSHOPに以下のスクリプトを加えるとEmueraでの動作を禁止できます。</br>
+
For example, adding the following script to @SHOWSHOP can prohibit operation on Emuera.</br>
  
;!;PRINTW このスクリプトはEmueraでは実行できません
+
;!;PRINTW This script cannot be executed in Emuera
;!;QUIT
+
;!;QUIT
  
また、[SKIPSTART][SKIPEND]と併用することで、以下のスクリプトのようにEmuera以外での動作を禁止できます。</br>
+
(Also, by using it together with [SKIPSTART] and [SKIPEND], you can prohibit the operation of other than Emuera like the following script.)</br>
Emuera以外では実行してほしくない文を記述する際に使ってください。
+
Use this when writing statements that you do not want to be executed except by Emuera.
  
;!;[SKIPSTART]
+
;!;[SKIPSTART]
PRINTW このスクリプトはEmuera以外では実行できません
+
PRINTW This script cannot be executed except by Emuera
QUIT
+
QUIT
;!;[SKIPEND]
+
;!;[SKIPEND]
  
 
=== ;#; ===
 
=== ;#; ===
<nowiki>;#;</nowiki>で始まる行はデバッグモード時のみ実行されます。</br>
+
Lines starting with ;#; are executed only in debug mode.</br>
非デバッグモード時ではコメント行と見なされ実行されません。</br>
+
In non-debug mode, it is regarded as a comment line and is not executed.</br>
ただし、DEBUG系命令は元々非デバッグモード時には無視されるので、;#;を行頭に付ける必要はありません。</br>
+
However, since DEBUG instructions are originally ignored in non-debug mode, there is no need to prefix ;#; to the line. </br>
同様にデバッグ変数も非デバッグモード時には空文字列又は0のため、エラーの心配はありません。</br>
+
Similarly, debug variables are empty strings or 0 in non-debug mode, so there is no worry about errors.</br>
デバッグモードについては[[../debug|こちら]]を参照してください。
+
See [../debug|here] for debug mode.
  
== キャラクタ配列 ==
+
== Character Array ==
eramakerではおそらくキャラクタ作成用の配列が100個しか用意されていません。</br>
+
eramaker probably has only 100 arrays for character creation.</br>
そのため、chara3.csvとchara03.csvとchara3B.csvでそれぞれ別のキャラを定義しても一人しか有効になりません。</br>
+
Therefore, even if different characters are defined in chara3.csv, chara03.csv, and chara3B.csv, only one person is valid.</br>
Emueraではキャラクタはメモリが許す限りいくらでも定義できます。</br>
+
In Emuera, characters can be defined as many as memory allows.</br>
また、"chara*.csv"に該当すればchara101.csv、charaABC.csvなどどんなファイルでも読みに行きます。</br>
+
Also, if it corresponds to "chara*.csv", it will read any file such as chara101.csv, charaABC.csv</br>
キャラの番号が重複し、ADDCHARA又はADDSPCHARAの際に複数の候補がある場合、先に読み込まれた方のみが有効になります。
+
If the character number is duplicated and there are multiple candidates for ADDCHARA or ADDSPCHARA, only the one that was read first will be valid.
  
== 整数型の値の範囲 ==
+
== Integer Value Range ==
eramakerで扱える整数は32ビット符号付整数、すなわち-2147483648~2147483647の範囲です。</br>
+
Integers that can be handled by eramaker are 32-bit signed integers, that is, in the range from -2147483648 to 2147483647.</br>
Emueraでは吉里吉里と同じく64ビット符号付整数、-9223372036854775808~9223372036854775807の範囲の値を扱います。
+
Emuera handles 64-bit signed integers in the same range as Kirikiri (吉里吉里), from -9223372036854775808 to 9223372036854775807.
  
 +
== Batch Assignment to Array Variables ==
  
== 配列変数への一括代入 ==
+
A:10 = 1,2,3
 +
DA:0:0 = 1,2,3
  
A:10 = 1,2,3
+
When written as above, the values ​​of 1, 2, and 3 are assigned to A:10 to A:12, respectively</br>
DA:0:0 = 1,2,3
+
In the following multidimensional array, values of 1, 2, and 3 are assigned to DA:0:0 to DA:0:2, respectively.</br>
 +
DA:0:0 to DA:0:99 is not assigned to DA:1:0, and an out-of-array reference error occurs<br>
 +
However, it cannot be used for compound assignment (A += 1,2,3 etc.).</br>
 +
Also, when using batch assignment for assignment to a string type array variable, you must perform [../exetc#Assignment to a String Variable Using a String Expression|assignment using a string expression]
  
上のように書いた場合、A:10~A:12にそれぞれ1,2,3の値が代入されます</br>
+
;The string "Strawberry, Melon, Blue Hawaii" is assigned to STR: 20
下のような多次元配列では、DA:0:0~DA:0:2にそれぞれ1,2,3の値が代入されます</br>
+
STR:20 = Strawberry, Melon, Blue Hawaii
DA:0:0~DA:0:99の次にDA:1:0に代入することはなく、配列外参照エラーになります</br>
+
;"Strawberry", "Melon", "Blue Hawaii" are assigned to STR:20~STR:22 respectively
ただし、複合代入演算には使えません(A += 1,2,3 などは不可)。</br>
+
STR:20 '= "Strawberry", "Melon", "Blue Hawaii"
また、文字列型配列変数への代入に一括代入を用いる場合、[exetc#h4-.E6.96.87.E5.AD.97.E5.88.97.E5.BC.8F.E3.82.92.E7.94.A8.E3.81.84.E3.81.9F.E6.96.87.E5.AD.97.E5.88.97.E5.A4.89.E6.95.B0.E3.81.B8.E3.81.AE.E4.BB.A3.E5.85.A5 文字列式を用いた代入]を行わなくてはなりません
 
  
;STR:20に「いちご,メロン,ブルーハワイ」という文字列が代入される
+
== Assignment to String Variable Using FORM Syntax ==
STR:20 = いちご,メロン,ブルーハワイ
+
When assigning to a string variable, you can specify the character string to be assigned in the same format as PRINTFORM.
;STR:20~STR22にそれぞれ「いちご」「メロン」「ブルーハワイ」が代入される
 
STR:20 '= "いちご", "メロン", "ブルーハワイ"
 
  
 +
SAVESTR:0 = %RESULTS%
  
== FORM構文を用いた文字列変数への代入 ==
+
In this statement, you can substitute the contents of RESULTS for SAVESTR:0.</br>
文字列変数への代入の際、PRINTFORMと同じ形式で代入する文字列を指定できます。
+
The same statement means that eramaker substitutes the actual string of %RESULTS% for SAVESTR:0.</br>
 +
If you want to substitute for the string %RESULTS% itself in Emuera, write as follows:
  
SAVESTR:0 = %RESULTS%
+
SAVESTR:0 = \%RESULT\%
  
この文でSAVESTR:0にRESULTSの中身を代入することができます。</br>
+
The character immediately after the \ symbol is not treated as a system symbol.</br>
同じ文はeramakerではSAVESTR:0に%RESULTS%という文字列そのものを代入したことになります。</br>
+
If you want to include the \ symbol in the string, use \\.</br>
Emueraで%RESULTS%という文字列そのものを代入したい場合、以下のように書いてください。
+
</br>
 +
In the rare case, if you want the same behavior on eramaker and Emuera, you need to write as follows.</br>
  
SAVESTR:0 = \%RESULT\%
+
;!;SAVESTR:0 = \%RESULT\%
 +
;!;[SKIPSTART]
 +
SAVESTR:0 = %RESULTS%
 +
;!;[SKIPEND]
  
\記号の直後の文字はシステム記号として扱われません。</br>
+
== Assignment to a String Variable Using a String Expression ==
\記号自体を文字列に含めたい場合は\\としてください。
 
  
あまりないケースですが、eramakerとEmueraで同じ動作をさせたい場合は以下のように書く必要があります。</br>
+
In Emuera after ver1813, assignment to string variables can be newly performed using the assignment operator '= and a string expression.
  
;!;SAVESTR:0 = \%RESULT\%
+
;Same as "STR = Ayu"
;!;[SKIPSTART]
+
STR '= "Ayu"
SAVESTR:0 = %RESULTS%
+
;Same as "STR = %TSTR:0%ABC"
;!;[SKIPEND]
+
STR '= TSTR:0 + "ABC"
  
 +
== Specifying Array Variable Elements Using Character Strings ==
  
== 文字列式を用いた文字列変数への代入 ==
+
For the following variables, the argument can be called as a character string defined in *.csv.</br>
ver1813以降のEmueraでは新たに、代入演算子'=と文字列式を用いて文字列変数への代入を行うことができます。
+
For details on the new variables of Emuera, see [../exvar|Extended Syntax-Constants and Variables Added by Emuera].
  
;「STR = あいう」と同様
+
ITEM (item.csv)
STR '= "あいう"
+
ITEMSALES (item.csv)
;「STR = %TSTR:0%いろは」と同様
+
LOSEBASE (base.csv)
STR '= TSTR:0 + "いろは"
+
BASE (base.csv)
 
+
MAXBASE (base.csv)
 
+
ABL (abl.csv)
== 文字列による配列変数の要素の指定 ==
+
TALENT (talent.csv)
以下の変数について、引数を*.csvで定義した文字列にして呼び出すことができます。</br>
+
EXP (exp.csv)
Emueraの新規変数についての詳細は[[../exvar|Emueraで追加された拡張文法 - 定数・変数]]をご覧ください。
+
MARK (mark.csv)
 
+
RELATION (chara*.csv)
ITEM (item.csv)
+
UP (palam.csv)
ITEMSALES (item.csv)
+
DOWN (palam.csv)
LOSEBASE (base.csv)
+
PALAM (palam.csv)
BASE (base.csv)
+
JUEL (palam.csv)
MAXBASE (base.csv)
+
GOTJUEL (palam.csv)
ABL (abl.csv)
+
STAIN (stain.csv)
TALENT (talent.csv)
+
SOURCE (source.csv)
EXP (exp.csv)
+
EX (ex.csv)
MARK (mark.csv)
+
NOWEX (ex.csv)
RELATION (chara*.csv)
+
TEQUIP (tequip.csv)
UP (palam.csv)
+
EQUIP (equip.csv)
DOWN (palam.csv)
+
FLAG (flag.csv)
PALAM (palam.csv)
+
TFLAG (tflag.csv)
JUEL (palam.csv)
+
CFLAG (cflag.csv)
GOTJUEL (palam.csv)
+
STR (strname.csv)
STAIN (stain.csv)
+
SAVESTR (savestr.csv)
SOURCE (source.csv)
 
EX (ex.csv)
 
NOWEX (ex.csv)
 
TEQUIP (tequip.csv)
 
EQUIP (equip.csv)
 
FLAG (flag.csv)
 
TFLAG (tflag.csv)
 
CFLAG (cflag.csv)
 
STR (strname.csv)
 
SAVESTR (savestr.csv)
 
 
   
 
   
The following are variables added by Emuera
+
The following are variables added by Emuera
ITEMPRICE (item.csv)
 
DOWNBASE (base.csv)
 
CUP (palam.csv)
 
CDOWN (palam.csv)
 
TCVAR (tcvar.csv)
 
TSTR (tstr.csv)
 
CSTR (cstr.csv)
 
CDFLAG (cdflag1.csv, cdflag2.csv)
 
GLOBAL (global.csv)
 
GLOBALS (globals.csv)
 
  
例えばabl.csvに"2,技巧"という定義があれば、以下の4つの行は同じ意味になります。
+
ITEMPRICE (item.csv)
 +
DOWNBASE (base.csv)
 +
CUP (palam.csv)
 +
CDOWN (palam.csv)
 +
TCVAR (tcvar.csv)
 +
TSTR (tstr.csv)
 +
CSTR (cstr.csv)
 +
CDFLAG (cdflag1.csv, cdflag2.csv)
 +
GLOBAL (global.csv)
 +
GLOBALS (globals.csv)
  
ABL:技巧 += 1
+
For example, if abl.csv has the definition "2, Skill", the following four lines have the same meaning.
ABL:2 += 1
 
ABL:"技巧" += 1
 
ABL:(ABLNAME:2) += 1
 
  
RELATIONについてはNAME、CALLNAMEのいずれでも指定できます。</br>
+
ABL:Skill += 1
同名で複数の定義がある場合、先に定義されている方が呼ばれます。</br>
+
ABL:2 += 1
例えばabl.csvに"2,技巧"と"4,技巧"があり、"2,技巧"の方が前の行で定義されているならば、"ABL:技巧""ABL:2"になります。</br>
+
ABL:"Skill" += 1
文字列は式や変数でも可能です。その場合は以下のように()を付けてください。
+
ABL:(ABLNAME:2) += 1
  
ABL:(RESULTS:0) = ABL:(RESULTS:0) + 1
+
For RELATION, you can specify either NAME or CALLNAME.</br>
 +
If there are multiple definitions with the same name, the one defined first will be called.</br>
 +
For example, if abl.csv contains "2, Skill" and "4, Skill", and "2, Skill" is defined in the previous line, "ABL:Skill" becomes "ABL:2".</br>
 +
Strings can be expressions or variables. In that case, please add () as shown below.
  
()を省略した場合、アイテム名と変数名が同一になる場合があります。その場合は変数が優先されます。</br>
+
ABL:(RESULTS:0) = ABL:(RESULTS:0) + 1
例えばabl.csvに"0,ローター"という定義がある場合、
 
  
@HOGE
+
If () is omitted, the item name and the variable name may be the same. In that case, the variable takes precedence.</br>
#DIM ローター, 0
+
For example, if abl.csv has the definition "0, Rotor",
ローター = 1
 
PRINTFORML {ABL:ローター}
 
  
この場合、0番目のABLではなく1番目のABLであると解釈されます。</br>
+
@HOGE
同様に、アイテム名が数値の場合、数値としての解釈が優先されます。</br>
+
#DIM Rotor, 0
例えばabl.csvに"0,10"という定義をしABL:10を参照した場合は0番目のABLとは解釈されず10番目のABLとなります。</br>
+
Rotor = 1
 +
PRINTFORML {ABL:Rotor}
  
これはchara*.csv内の定義においても使用できます。</br>
+
In this case, it is interpreted as the first ABL, not the zeroth ABL.</br>
例えばabl.csvに"2,技巧"という定義があれば、以下の2つの行は同じ意味になります。
+
Similarly, if the item name is a number, interpretation as a number takes precedence.</br>
 +
For example, if you define "0,10" in abl.csv and refer to ABL: 10, it will not be interpreted as the 0th ABL and will be the 10th ABL.</br>
 +
<br>
 +
This can also be used in definitions in chara*.csv.</br>
 +
For example, if abl.csv has the definition "2, Skill", the following two lines have the same meaning:<br>
  
能力,2,2
+
能力,2,2
能力,技巧,2
+
能力,Skill,2
  
ただし、相性(RELATION)には使えません。</br>
+
However, it cannot be used for RELATION(相性).</br>
chara*.csvを読んでいる段階ではシステムがcharaの名前とNOの対応を把握していないためです。
+
This is because the system does not know the correspondence between chara name and NO when reading chara*.csv.
  
== 書式付文字列(FORM構文)拡張 ==
+
== Formatted String (FORM Syntax) Extension ==
 
PRINTFORMなどでつかわれる書式付文字列のうち、{}、%%に表示桁数(文字数)を指定できます。</br>
 
PRINTFORMなどでつかわれる書式付文字列のうち、{}、%%に表示桁数(文字数)を指定できます。</br>
 
{変数・数式等, 表示桁数, 揃え(LEFT or RIGHT)}、%変数、文字列式等, 表示桁数, 揃え(LEFT or RIGHT)%という形式で指定します。</br>
 
{変数・数式等, 表示桁数, 揃え(LEFT or RIGHT)}、%変数、文字列式等, 表示桁数, 揃え(LEFT or RIGHT)%という形式で指定します。</br>
Line 204: Line 203:
 
指定された表示桁数よりもとの桁数の方が大きい場合、そのまま表示します。
 
指定された表示桁数よりもとの桁数の方が大きい場合、そのまま表示します。
  
A = 123456
+
A = 123456
STR:0 = あいう
+
STR:0 = あいう
PRINTFORML [{A}]
+
PRINTFORML [{A}]
PRINTFORML [{A,10}]
+
PRINTFORML [{A,10}]
PRINTFORML [{A,10,LEFT}]
+
PRINTFORML [{A,10,LEFT}]
PRINTFORML [%STR:0%]
+
PRINTFORML [%STR:0%]
PRINTFORML [%STR:0,10%]
+
PRINTFORML [%STR:0,10%]
PRINTFORML [%STR:0,10,LEFT%]
+
PRINTFORML [%STR:0,10,LEFT%]
PRINTFORML [{A,2}]
+
PRINTFORML [{A,2}]
PRINTFORML [%STR:0,2%]
+
PRINTFORML [%STR:0,2%]
;結果
+
 
 +
Results
 +
 
 
  [123456]
 
  [123456]
 
  [    123456]
 
  [    123456]
Line 223: Line 224:
 
  [123456]
 
  [123456]
 
  [あいう]
 
  [あいう]
 
  
 
== 文字列式中での書式付文字列(FORM構文)の使用 ==
 
== 文字列式中での書式付文字列(FORM構文)の使用 ==
Line 232: Line 232:
  
 
正しい例
 
正しい例
;代入はFORM構文
+
;代入はFORM構文
STR:0 = あいう
+
STR:0 = あいう
;加算は文字列式
+
;加算は文字列式
RESULTS += STR:0
+
RESULTS += STR:0
;文字列式に定文字列を使用する例
+
;文字列式に定文字列を使用する例
RESULTS += "えお"
+
RESULTS += "えお"
;文字列式にFORM構文を使用する例
+
;文字列式にFORM構文を使用する例
PRINTS @"%RESULTS%かきくけこ"
+
PRINTS @"%RESULTS%かきくけこ"
  
;以下の4行はすべて同じである
+
;以下の4行はすべて同じである
PRINTS STR:0 + "!"
+
PRINTS STR:0 + "!"
PRINTFORM %STR:0%!
+
PRINTFORM %STR:0%!
PRINTS @"%STR:0%!"
+
PRINTS @"%STR:0%!"
PRINTFORM %STR:0 + "!"%
+
PRINTFORM %STR:0 + "!"%
 
間違った例
 
間違った例
;中身が「RESULTS」になる
+
;中身が「RESULTS」になる
STR:0 = RESULTS
+
STR:0 = RESULTS
;エラーが出る
+
;エラーが出る
RESULTS += えお
+
RESULTS += えお
;エラーが出る
+
;エラーが出る
RESULTS += %STR:0%
+
RESULTS += %STR:0%
;「@"」と「"」も表示される
+
;「@"」と「"」も表示される
PRINTFORM @"%RESULTS%かきくけこ"
+
PRINTFORM @"%RESULTS%かきくけこ"
 
 
  
 
== INPUTS系でのマクロ構文の使用 ==
 
== INPUTS系でのマクロ構文の使用 ==

Revision as of 16:51, 19 March 2020

End of line comment

A = B ;Substitute A for B

You can insert a comment at the end of a line in this way.
However, there are some exceptions, and if the argument is a simple string instruction such as the “PRINT” instruction, it will be evaluated as part of the string without commenting

PRINT foo;bar

In this case, "foo;bar" is PRINTed.

Concatenate Rows

{
	DIM CONST HOGE =
		1,2,3,4
}

Will be interpreted as "#DIM CONST HOGE = 1,2,3,4"
'{' and '}' lines must not contain any other characters besides white space.
One-byte space is added at the position where there is a line feed symbol.
In other words, lines cannot be split in the middle of function names and variable names,
If you divide PRINT etc., the display character string will include the half-width space that was a line feed
In Emuera's grammatical interpretation, line continuation processing is performed before interpretation of comments.
In other words

{
	#DIM CONST HOGE =
		1,2,3,4 ;comment
		,5,6,7,8
}

Becomes "#DIM CONST HOGE = 1,2,3,4 ;comment ,5,6,7,8",
",5,6,7,8" is considered part of the end-of-line comment and ignored.

Special Comment Line

;!;

In both Emuera and eramaker, lines starting with ; are considered comment lines, but Emuera considers lines starting with ;!; To be valid lines, not comments.
Use this when writing statements that you do not want eramaker to execute.
For example, adding the following script to @SHOWSHOP can prohibit operation on Emuera.

;!;PRINTW This script cannot be executed in Emuera
;!;QUIT

(Also, by using it together with [SKIPSTART] and [SKIPEND], you can prohibit the operation of other than Emuera like the following script.)
Use this when writing statements that you do not want to be executed except by Emuera.

;!;[SKIPSTART]
PRINTW This script cannot be executed except by Emuera
QUIT
;!;[SKIPEND]

;#;

Lines starting with ;#; are executed only in debug mode.
In non-debug mode, it is regarded as a comment line and is not executed.
However, since DEBUG instructions are originally ignored in non-debug mode, there is no need to prefix ;#; to the line.
Similarly, debug variables are empty strings or 0 in non-debug mode, so there is no worry about errors.
See [../debug|here] for debug mode.

Character Array

eramaker probably has only 100 arrays for character creation.
Therefore, even if different characters are defined in chara3.csv, chara03.csv, and chara3B.csv, only one person is valid.
In Emuera, characters can be defined as many as memory allows.
Also, if it corresponds to "chara*.csv", it will read any file such as chara101.csv, charaABC.csv
If the character number is duplicated and there are multiple candidates for ADDCHARA or ADDSPCHARA, only the one that was read first will be valid.

Integer Value Range

Integers that can be handled by eramaker are 32-bit signed integers, that is, in the range from -2147483648 to 2147483647.
Emuera handles 64-bit signed integers in the same range as Kirikiri (吉里吉里), from -9223372036854775808 to 9223372036854775807.

Batch Assignment to Array Variables

A:10 = 1,2,3
DA:0:0 = 1,2,3

When written as above, the values ​​of 1, 2, and 3 are assigned to A:10 to A:12, respectively
In the following multidimensional array, values of 1, 2, and 3 are assigned to DA:0:0 to DA:0:2, respectively.
DA:0:0 to DA:0:99 is not assigned to DA:1:0, and an out-of-array reference error occurs
However, it cannot be used for compound assignment (A += 1,2,3 etc.).
Also, when using batch assignment for assignment to a string type array variable, you must perform [../exetc#Assignment to a String Variable Using a String Expression|assignment using a string expression]

;The string "Strawberry, Melon, Blue Hawaii" is assigned to STR: 20
STR:20 = Strawberry, Melon, Blue Hawaii
;"Strawberry", "Melon", "Blue Hawaii" are assigned to STR:20~STR:22 respectively
STR:20 '= "Strawberry", "Melon", "Blue Hawaii"

Assignment to String Variable Using FORM Syntax

When assigning to a string variable, you can specify the character string to be assigned in the same format as PRINTFORM.

SAVESTR:0 = %RESULTS%

In this statement, you can substitute the contents of RESULTS for SAVESTR:0.
The same statement means that eramaker substitutes the actual string of %RESULTS% for SAVESTR:0.
If you want to substitute for the string %RESULTS% itself in Emuera, write as follows:

SAVESTR:0 = \%RESULT\%

The character immediately after the \ symbol is not treated as a system symbol.
If you want to include the \ symbol in the string, use \\.

In the rare case, if you want the same behavior on eramaker and Emuera, you need to write as follows.

;!;SAVESTR:0 = \%RESULT\%
;!;[SKIPSTART]
SAVESTR:0 = %RESULTS%
;!;[SKIPEND]

Assignment to a String Variable Using a String Expression

In Emuera after ver1813, assignment to string variables can be newly performed using the assignment operator '= and a string expression.

;Same as "STR = Ayu"
STR '= "Ayu"
;Same as "STR = %TSTR:0%ABC"
STR '= TSTR:0 + "ABC"

Specifying Array Variable Elements Using Character Strings

For the following variables, the argument can be called as a character string defined in *.csv.
For details on the new variables of Emuera, see [../exvar|Extended Syntax-Constants and Variables Added by Emuera].

ITEM (item.csv)
ITEMSALES (item.csv)
LOSEBASE (base.csv)
BASE (base.csv)
MAXBASE (base.csv)
ABL (abl.csv)
TALENT (talent.csv)
EXP (exp.csv)
MARK (mark.csv)
RELATION (chara*.csv)
UP (palam.csv)
DOWN (palam.csv)
PALAM (palam.csv)
JUEL (palam.csv)
GOTJUEL (palam.csv)
STAIN (stain.csv)
SOURCE (source.csv)
EX (ex.csv)
NOWEX (ex.csv)
TEQUIP (tequip.csv)
EQUIP (equip.csv)
FLAG (flag.csv)
TFLAG (tflag.csv)
CFLAG (cflag.csv)
STR (strname.csv)
SAVESTR (savestr.csv)

The following are variables added by Emuera

ITEMPRICE (item.csv)
DOWNBASE (base.csv)
CUP (palam.csv)
CDOWN (palam.csv)
TCVAR (tcvar.csv)
TSTR (tstr.csv)
CSTR (cstr.csv)
CDFLAG (cdflag1.csv, cdflag2.csv)
GLOBAL (global.csv)
GLOBALS (globals.csv)

For example, if abl.csv has the definition "2, Skill", the following four lines have the same meaning.

ABL:Skill += 1
ABL:2 += 1
ABL:"Skill" += 1
ABL:(ABLNAME:2) += 1

For RELATION, you can specify either NAME or CALLNAME.
If there are multiple definitions with the same name, the one defined first will be called.
For example, if abl.csv contains "2, Skill" and "4, Skill", and "2, Skill" is defined in the previous line, "ABL:Skill" becomes "ABL:2".
Strings can be expressions or variables. In that case, please add () as shown below.

ABL:(RESULTS:0) = ABL:(RESULTS:0) + 1

If () is omitted, the item name and the variable name may be the same. In that case, the variable takes precedence.
For example, if abl.csv has the definition "0, Rotor",

@HOGE
#DIM Rotor, 0
Rotor = 1
PRINTFORML {ABL:Rotor}

In this case, it is interpreted as the first ABL, not the zeroth ABL.
Similarly, if the item name is a number, interpretation as a number takes precedence.
For example, if you define "0,10" in abl.csv and refer to ABL: 10, it will not be interpreted as the 0th ABL and will be the 10th ABL.

This can also be used in definitions in chara*.csv.
For example, if abl.csv has the definition "2, Skill", the following two lines have the same meaning:

能力,2,2
能力,Skill,2

However, it cannot be used for RELATION(相性).
This is because the system does not know the correspondence between chara name and NO when reading chara*.csv.

Formatted String (FORM Syntax) Extension

PRINTFORMなどでつかわれる書式付文字列のうち、{}、%%に表示桁数(文字数)を指定できます。
{変数・数式等, 表示桁数, 揃え(LEFT or RIGHT)}、%変数、文字列式等, 表示桁数, 揃え(LEFT or RIGHT)%という形式で指定します。
文字数は全角文字を2文字と数えます。
表示桁数(文字数)に足りない部分は半角スペースが追加されます。
通常は右揃えですが、キーワードLEFTを指定すると左揃えになります。
指定された表示桁数よりもとの桁数の方が大きい場合、そのまま表示します。

A = 123456
STR:0 = あいう
PRINTFORML [{A}]
PRINTFORML [{A,10}]
PRINTFORML [{A,10,LEFT}]
PRINTFORML [%STR:0%]
PRINTFORML [%STR:0,10%]
PRINTFORML [%STR:0,10,LEFT%]
PRINTFORML [{A,2}]
PRINTFORML [%STR:0,2%]

Results

[123456]
[    123456]
[123456    ]
[あいう]
[    あいう]
[あいう    ]
[123456]
[あいう]

文字列式中での書式付文字列(FORM構文)の使用

PRINTSやユーザー定義の式中関数の引数といった文字列式中でFORM構文を使用するとエラーになります。
そのため文字列式中で書式付文字列を使用する場合、文字列式中で定文字列を使うときに"~"を使用するのと同じように
@"~"を使用します。 また、@"~"の中の文字列が\@~\@を用いた三項演算子による記載のみである場合、@"~"を省略して直接\@~\@と書くことができます

正しい例

;代入はFORM構文
STR:0 = あいう
;加算は文字列式
RESULTS += STR:0
;文字列式に定文字列を使用する例
RESULTS += "えお"
;文字列式にFORM構文を使用する例
PRINTS @"%RESULTS%かきくけこ"
;以下の4行はすべて同じである
PRINTS STR:0 + "!"
PRINTFORM %STR:0%!
PRINTS @"%STR:0%!"
PRINTFORM %STR:0 + "!"%

間違った例

;中身が「RESULTS」になる
STR:0 = RESULTS
;エラーが出る
RESULTS += えお
;エラーが出る
RESULTS += %STR:0%
;「@"」と「"」も表示される
PRINTFORM @"%RESULTS%かきくけこ"

INPUTS系でのマクロ構文の使用

INPUTSやそれに類する入力受付命令で、マクロ式を用いることができます。
マクロの書式については利用方法のマクロの項目を確認してください。
マクロ構文を使わず、単なる文字列として()を使用する場合、\を用いてエスケープしてください。