//-------------------------------------- //--- 010 Editor v3.2.2 Script File // // File:StringPlus.1sc // Author:N0VA8o.lau@gmail.com // Revision:1.0 // Purpose:Each char of string plus or subtract a number //-------------------------------------- const string title = "String Plus"; int64 adr, siz, out, index; int actfile, newfile, bits; int iKey; char tmp; if (FileCount() == 0) { MessageBox(idOk, title, "No file is open."); return -1; } if (GetSelSize() <= 0) { adr = 0; siz = FileSize(); } else { adr = GetSelStart(); siz = GetSelSize(); } if (siz == 0) { MessageBox(idOk, title, "No bytes to process."); return -1; } if (siz == 0) { MessageBox(idOk, title, "No bytes to process."); return -1; } iKey = InputNumber(title, "Integer Please:", "0"); bits = 0; out = 0; actfile = GetFileNum(); newfile = FileNew(); FileSelect(actfile); index = adr; while( index < adr + siz) { FileSelect(actfile); tmp = ReadByte(index); FileSelect(newfile); tmp = tmp+iKey; WriteByte(out, tmp); index++; out++; } FileSelect(newfile); SetCursorPos(FileSize());