Light!


Quote:
You are wrong about $read being slow or dangerous. Within $read() you can specify the line number to start at, so you wont have to $read from the beginning of the file twice in a row. Similar to /fseek function, but better.[


Hey, i think you're missing my point smile
$read and /write are slow, because in every call they open then read then close the file. they are dangerous, because if they fail to open the file, they halt the entire script without warning. but $read & /write's features are cool, so i think it shouldn't be so hard to write them a switch to work on an already opened file. in mirc script (just for everyone to understand), it'd be something like that:

var %filehandle = openfile_temp-blaah
if (-*o* iswm %switches) %filehandle = %o
else fopen %filehandle %file

...

if (-*o* iswm %switches) return
else fclose %filehandle


i hope everyone understands what i mean smile the code could remain the same, just cutting off the file closes and opens if that switch and opened file handle is given. BAH! a long post again! laugh


sorry for my bad english
watch out when you're in front of my scalar howitzer smile

Punks not dead!