Write exact text bytes
ASPL 0.7.0 · Current release
Complete supplied source, preparation, and checked ASPL 0.7.0 outcomes.
On this page
Purpose and preparation
Browser and native, ASPL 0.7.0. Needs no input or asset. Creates or replaces generated.txt with exactly generated\n, prints Output: saved\n, and returns 0.
See the current reference. No source module or external library is required.
Read Text files and recoverable failures before importing data or writing a native destination. New browser drafts start with empty run files.
Arabic source
This supplied complete source opens a new draft. Prepare the declared inputs/files in that draft, then select Run explicitly.
Execution: Browser and native · ASPL 0.7.0
- No input or asset is required. Run creates or replaces generated.txt with generated followed by LF.
- Browser writes are temporary until explicitly downloaded. Native writes replace the destination in the process working directory.
Input: No input lines are required.
دالة ابدأ_الرئيسية() -> ص64 {
اطبع("Output: ").
دع المحفوظ: نتيجة<وحدة> = اكتب_ملف_نصي("generated.txt", "generated\س").
إذا (المحفوظ::نجاح) {
اطبع("saved\س").
} وإلا {
اطبع("error: ").
اطبع(المحفوظ::الخطأ::الرمز).
اطبع("\س").
}
أرجع 0.
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "Output: saved\n",
"fileUpdates": [
{
"name": "generated.txt",
"content": "generated\n"
}
],
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "Output: saved\n"
}
}English source
This supplied complete source opens a new draft. Prepare the declared inputs/files in that draft, then select Run explicitly.
Execution: Browser and native · ASPL 0.7.0
- No input or asset is required. Run creates or replaces generated.txt with generated followed by LF.
- Browser writes are temporary until explicitly downloaded. Native writes replace the destination in the process working directory.
Input: No input lines are required.
fn start_main() -> i64 {
print("Output: ");
let saved: result<unit> = write_text_file("generated.txt", "generated\n");
if (saved::ok) {
print("saved\n");
} else {
print("error: ");
print(saved::error::code);
print("\n");
}
return 0;
}
Expected outcomes
{
"browser": {
"check": "success",
"class": "success",
"output": "Output: saved\n",
"fileUpdates": [
{
"name": "generated.txt",
"content": "generated\n"
}
],
"processStatus": 0
},
"native": {
"check": 0,
"status": 0,
"output": "Output: saved\n"
}
}Check the result
The source cards show the catalog's exact inputs and outcomes. Locale changes do not translate the supplied source. Download retains original source bytes.