1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/eagle-5.7.0/ulp/ex-file-copy.ulp
Eve Entropia 157fd6f1a1 eagle
2010-03-30 20:14:34 +02:00

30 lines
727 B
Text

#usage "<b>Example: Copy a file</b>\n"
"<p>"
"<author>Author: support@cadsoft.de</author>"
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED
string fileName;
string test = "";
int Result = 0;
int nBytes = 0;
int start = 0;
char c[];
fileName = dlgFileOpen("Select a file", "*.*");
nBytes = fileread(c, fileName);
sprintf(test, "%d = &%x", nBytes, nBytes);
dlgMessageBox("Length of File = " + test);
dlgMessageBox("Write " + fileName + "?");
fileName += ".copy";
output(fileName, "wb") {
for (int z = 0; z < nBytes; z++) {
printf("%c", c[z]);
Result = z+1;
}
}
sprintf(test, "%d = $%x", Result, Result);
dlgMessageBox("Length of File = " + test, "OK");