mIRC Homepage
Hi, im working on a file searching script, and it returns full paths to mirc, thus using more than what mirc allows, is there a way to work around this problem?

function gets called and returns:
a:\kjfh,jfhljd\fdjkfdg\77493847\file.txt
b:\kjfh,jfhljd\fdjkfdg\77493847\file.mrc
c:\kjfh,jfhljd\fdjkfdg\77493847\file.fdf
d:\kjfh,jfhljd\fdjkfdg\77493847 \file.doc
e:\kjfh,jfhljd\fdjkfdg\77493847 \file.nfo

Any Ideas?
filenames are limited to the constant MAX_PATH wich is 256. 900 is way more than that. for individual files this should be enough. if your trying to fill the data variable with multiple files i would recomend against it. alternatively you can use a custom alias or signal wich is called once for each file. this allows you to send multiple files with just one call and still remain under 900. you cannot alter the data variables size (realloc wont work because mirc expects it to be 900 so it wont use anything above that. also the pointer returned from realloc is not garaunteed to be the same altho there is a workaround for that).
Problem is the function returns multiple filenames and relative paths
then most likely youll want to take advantage of the mapped file ability and call an alias or signal passing in each filename found.
also, if you REALLY want to pass all the files in the returned value, you might try replacing text in the files with identifiers such as $mircdir. you can use SendMessage with file mapping (look up SendMessage in mIRCs helpfile if you are unsure of what i mean) to evaluate identifiers suck as $mircdir. This would only apply if the files are within mIRCs dir though. also using the short filename as opposed to the long filename will aslo save you some length. even so you should still use custom signals rather than this method because there is no gaurantee that this list will be less than 900 chars.
try to put it in a binvar
© mIRC Discussion Forums