String replace 'empty' by ends in Access vialotion at addres

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Dick99999
Pro Scripter
Posts: 84
Joined: Thu Nov 27, 2008 10:25 am
Location: Netherlands

String replace 'empty' by ends in Access vialotion at addres

Post by Dick99999 » Wed Sep 29, 2010 12:51 pm

The following code ends with the message:
Access violation at Address 00419AF5 in module 'msched.exe' Read of address 00000000.

It seems a heavy penalty for substituting 'nothing' by 'nothing'. Probably "a should not happen" case, yet difficult to pinpoint in a large script.

The code b.t.w. tries to delete the extension of a filename, which is not there in the sample.

Code: Select all

let>dataDirNew={"new"}
let>transfFile_VAR_1={"ir"}


    let>fnNew=%dataDirNew%\%transfFile_VAR_1%
    ExtractFileName>fnNew,fnOnly
    ExtractFileExt>fnNew,fileExt

   // next statement will end in a access violation
    StringReplace>fnOnly,fileExt,,fnzOnly

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Access Violation . I try this ...i hope it will help you

Post by olllllliii » Wed Sep 29, 2010 1:28 pm

let>dataDirNew={"new"}
let>transfFile_VAR_1={"ir"}


let>fnNew=%dataDirNew%\%transfFile_VAR_1%
ExtractFileName>fnNew,fnOnly
ExtractFileExt>fnNew,fileExt
IF>fileExt=""
StringReplace>fnOnly,fileExt,,fnzOnly
ELSE
// next statement will end in a access violation
// There is nothing to replace ..and nothing to do
Let>fnzOnly=fnOnly
ENDIF
Oliver Hilger Mannheim
alias Olllllliii

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Forgotten Space

Post by olllllliii » Wed Sep 29, 2010 1:46 pm

StringReplace>fnOnly,fileExt, ,fnzOnly

U have to replace this line in the script i posted ...( I made a mistake )
Oliver Hilger Mannheim
alias Olllllliii

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Sep 29, 2010 1:46 pm

Issue noted. Will be fixed in due course.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Dick99999
Pro Scripter
Posts: 84
Joined: Thu Nov 27, 2008 10:25 am
Location: Netherlands

Post by Dick99999 » Wed Sep 29, 2010 1:46 pm

Agree, and that should be done for all replace statements where this could happen ...........Wouldn't it be useful if replace 'an empty string' would deliver a defined result like the one you suggest: no change.

Like I said before, this errror takes some time pinpoint the crash location / statement in the script. Or is there a better way then inserting breakpoints?

=== edit
Sorry had not noticed responses 3 and 4. Glad it is on the list of 'will be fixed'.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts