Hey,
wenn ich das Script mit der Funktion compiliere kommen keine errors, filterscript wird auch geladen, aber bei FilterscriptInit() wird nichts geprintet.
Wenn ich den Stock Ausklammere geht wieder alles?
stock strDelete(string[], substring[])
{
if (!string[0]) return 0;
new
start,
end,
length;
start,
end,
length;
// Load both of the strings.
#emit LOAD.S.pri substring
#emit LOAD.S.alt string
#emit LOAD.S.pri substring
#emit LOAD.S.alt string
// Push them both into "strfind".
#emit PUSH.pri
#emit PUSH.alt
#emit PUSH.pri
#emit PUSH.alt
// Push the number of arguments.
#emit PUSH.C 8
// Load "start", since we're going to store the result of "strfind" into it.
#emit LOAD.S.pri start
#emit PUSH.C 8
// Load "start", since we're going to store the result of "strfind" into it.
#emit LOAD.S.pri start
// Call the "strfind" function.
#emit SYSREQ.C strfind
// Store the result in "start".
#emit STOR.S.pri start
#emit SYSREQ.C strfind
// Store the result in "start".
#emit STOR.S.pri start
if (start != -1)
{
// Erase the memory in pri and alt.
#emit ZERO.pri
#emit ZERO.alt
// Load the empty length variable and substring.
#emit LOAD.S.pri length
#emit LOAD.S.alt substring
// Push "substring" and the number of variables * bytes.
#emit PUSH.alt
#emit PUSH.C 4
{
// Erase the memory in pri and alt.
#emit ZERO.pri
#emit ZERO.alt
// Load the empty length variable and substring.
#emit LOAD.S.pri length
#emit LOAD.S.alt substring
// Push "substring" and the number of variables * bytes.
#emit PUSH.alt
#emit PUSH.C 4
// Call strlen and store the result in "length".
#emit SYSREQ.C strlen
#emit STOR.S.pri length
#emit SYSREQ.C strlen
#emit STOR.S.pri length
// Erase the memory AGAIN...
#emit ZERO.pri
#emit ZERO.alt
// Load "length" and "start" and add them together.
#emit LOAD.S.pri length
#emit LOAD.S.alt start
#emit ADD
// Store it in "end".
#emit STOR.S.pri end
#emit ZERO.pri
#emit ZERO.alt
// Load "length" and "start" and add them together.
#emit LOAD.S.pri length
#emit LOAD.S.alt start
#emit ADD
// Store it in "end".
#emit STOR.S.pri end
// Restore the stack.
#emit STACK 20
// Now delete the string.
return strdel(string, start, end), start;
}
return -1;
}
#emit STACK 20
// Now delete the string.
return strdel(string, start, end), start;
}
return -1;
}