IonicWind Snippit Manager 2.xx Released! Install it on a memory stick and take it with you! With or without IWBasic!
Started by philippe.tx, November 11, 2010, 03:21:27 pm
0 Members and 1 Guest are viewing this topic.
def in,out:filedef byte:charopenconsoleOpenfile (in,getstartpath+"toutes_donnees.cba","R")openfile(out,getstartpath+"blabla.cba","W")for i=1 to len(in) read (in,byte)print byte write (out,byte)next iclosefile inclosefile outend
DECLARE IMPORT, _ReadFile ALIAS ReadFile(hFile AS INT,lpBuffer AS POINTER,nNumberOfBytesToRead AS INT,lpNumberOfBytesRead AS POINTER,lpOverlapped AS OVERLAPPED),INT file fin,fout int bytesread istring path="" char InBuffer="" char OutBuffer="" char overflow="" if openfile(fin,path,"R") = 0 do InBuffer="" ReadFile(f,&Buffer,4096,&bytesread,NULL) if bytesread/* 'do the mid thing to see if you have a piece 'if a piece of data if overflow<>"" then add overflow to outbuffer and clear overflow then add it to outbuffer+LFCR 'if no end of data but not at end of inbuffer - means we broke in the middle of data set overflow to that leftover write out outbuffer set outbuffer=""*/ endif until bytesread=0 CloseFIle fin Closefile fout endifendsub