Quick Wimp question
Chris Dewhurst (1709) 167 posts |
Hi all, When a file is dragged onto an application from the filer and dealt with as per this snippet of code: SYS “Wimp_Poll”,0,block% TO event% DEF PROCmessage DEF PROCreceive why is size% reported as -1? The PRMs mention that block%!36 gives the (estimated) size of the incoming data so not sure what -1 means. I’m perhaps missing something obvious or do I need an extra line or two of code before the true size% is given? Thanks :) |
Chris Dewhurst (1709) 167 posts |
I should P.S. that I’ve got what I’ve needed by using an OS_File call to get the file’s size but I’m still puzzled by the above behaviour. |
Dave Higton (1515) 3526 posts |
I think -1 means that the sender does not know the file’s size. The information is of dubious trustworthiness at the best of times. |
Steve Fryatt (216) 2105 posts |
DEF PROCmessage CASE block%!16 OF WHEN 1:PROCreceive … ENDCASE ENDPROC Are you sure that’s correct? The Filer will send Message_DataLoad, which is 3; 1 is Message_DataSave, which would be an app-to-app or app-to-Filer transfer. |
Chris Dewhurst (1709) 167 posts |
Yes sorry Steve you are quite correct, I showed the wrong bit of my code and it should be WHEN 3:PROCreceive instead of WHEN 1:PROCreceive. App-to-app transfer does give a proper estimated file size at block%!36 but filer-to-app doesn’t, it returns -1 |