Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
On line 18 of routine "IsFileOrDir"
Do you know what type of error is it and how to repair the program?
http://www.winbatch.com/download.html
"1588: Unable to allocate or Lock memory" on line 27 BinaryReplace(bb, Old, new, @FALSE) using: WinBatch Studio 2006A WIL Version: 5.10aej :UDFUDS #DefineFunction standardedits(text, computername, username, rundate, humandate, machinedate, extracttime, today) text = StrReplaceNC(text, "#computername#", computername) text = StrReplaceNC(text, "#username#", username) text = StrReplaceNC(text, "#rundate#", rundate) text = StrReplaceNC(text, "#humandate#", humandate) text = StrReplaceNC(text, "#machinedate#", machinedate) text = StrReplaceNC(text, "#extracttime#", extracttime) text = StrReplaceNC(text, "#today#", today) Return(text) #EndFunction #DefineFunction StrReplaceNC(DaString,old,new) len = strlen(DaString) oldlen = strlen(old) newlen = strlen(new) bbsize = len If newlen>oldlen count = 0 i = 1 While @True i = StrIndexNC(DaString,old,i,@FwdScan) If i == 0 Break EndIf count = count + 1 i = i + oldlen EndWhile bbsize = bbsize+(count*(newlen-oldlen)) EndIf bb = BinaryAlloc(bbsize) BinaryPokeStr(bb, 0, DaString) BinaryReplace(bb, Old, new, @FALSE) ans = BinaryPeekStr(bb,0,BinaryEODGet(bb)) BinaryFree(bb) Drop(i, count, oldlen, newlen, bbsize, len) return (ans) #EndFunction Return
--- Leaving UDF (strreplacenc) --- len = strlen(DaString) (4078) VALUE INT => 0 oldlen = strlen(old) (4078) VALUE INT => 14 newlen = strlen(new) (4078) VALUE INT => 10 bbsize = len (4078) VALUE INT => 0 If newlen>oldlen (4078) END OPERATOR bb = BinaryAlloc(bbsize) (4078) VALUE BINBUF => 987659 BinaryPokeStr(bb, 0, DaString) (4078) VALUE INT => 0 BinaryReplace(bb, Old, new, @FALSE) (6235) VALUE INT => 0 TERMINAL WIL ERROR=>1588 (Unable to allocate or lock memory)
As a workaround, make sure that the binary buffer passed to BinaryReplace, bb in your case, has a size of at least one. Maybe
if bbsize < 1 then bbsize = 1
Article ID: W17406
File Created: 2009:08:11:08:35:02
Last Updated: 2009:08:11:08:35:02