DE CSharp Directive Load - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
.csx-Ausgänge anschließen
Handbuch C# · Praktischer Leitfaden
Die Skriptanweisung lädt eine weitere .csx-Datei. Für ein reguläres Projekt verwenden Sie Compile oder ProjectReference.
Einfaches Beispiel (Example.csx)
Speichern Sie dieses Beispiel separat als Example.csx. Führen Sie es unabhängig von den anderen Beispielen dieser Seite aus.
Example.csx:
#load "helper.csx"
UO.Print(Double(4).ToString());
helper.csx:
int Double(int value) => value * 2;
Ergebnis:
8
Syntax
#load "helper.csx"
Eine separate Hilfsfunktion
#load "helper.csx"
UO.Print(Double(4).ToString());
Datei helper.csx:
int Double(int value) => value * 2;
Konfigurationsdatei
#load "settings.csx"
UO.Print($"{ProfileName}:{Limit}");
Datei settings.csx:
string ProfileName = "Archer";
int Limit = 3;
Offizielle Quelle: Microsoft Learn.