rename function does not work as executable
Moderators: Dorian (MJT support), JRL
rename function does not work as executable
Hello,
im trying to rename a file, this works if i just do it with MS, but the time i compile it as a exe-file it does not work ?????
I cecked here the forum but it seems that im the only one who is having this problem, or not ?
Best
im trying to rename a file, this works if i just do it with MS, but the time i compile it as a exe-file it does not work ?????
I cecked here the forum but it seems that im the only one who is having this problem, or not ?
Best
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
There's no difference in the way compiled scripts are executed compared to how non compiled scripts are executed. I have no problem with RenameFile in an EXE.
Do you have the correct version of the compiler? Compile this script, run it and tell us what the message says:
MessageModal>MSCHED_VER
If I recall RenameFile is a recent addition, so if your compiler is out of date it will do nothing.
What happens if you do this instead:
Let>MF_RENAME=1
MoveFile>source,dest
Do you have the correct version of the compiler? Compile this script, run it and tell us what the message says:
MessageModal>MSCHED_VER
If I recall RenameFile is a recent addition, so if your compiler is out of date it will do nothing.
What happens if you do this instead:
Let>MF_RENAME=1
MoveFile>source,dest
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
That's not a rename, it's a move. So you should be using:
Let>oldfile=C:\directory\XREF.DAT
Let>newlocation=C:\
MoveFile>oldfile,newlocation
MessageModal>newfile2
Does c:\xref.dat already exist?
Which operating system are you running? Are you a regular user or an administrator? Only admins should have permission to create files in the c:\ root directory.
Let>oldfile=C:\directory\XREF.DAT
Let>newlocation=C:\
MoveFile>oldfile,newlocation
MessageModal>newfile2
Does c:\xref.dat already exist?
Which operating system are you running? Are you a regular user or an administrator? Only admins should have permission to create files in the c:\ root directory.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Greatworldwide wrote:Yes your right, sorry.
I checked your code and it works.
Wait a minute - it works or it doesn't work? Which is it?Am i missing here something ? Or do i something wrong ?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes, you said you were doing a rename, but you actually wanted to move a file to a different location.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
:D Ok, ill start again :-)
Heres my code, this one is only working as MS, the time ill make an exe-file from it it doesnt work :
---------------------
---------------------
Let>oldfile=C:\directory\XREF.DAT
ReadLn>oldfile,3,text
MidStr>text,69,11,show
Let>rest=show
MessageModal>show
Position>\,rest,1,start
Let>start=start+1
Length>rest,lf
MidStr>rest,start,lf,temp
Position>.,temp,1,end
Let>end=end-1
MidStr>temp,1,end,midPart
Let>newfile=%midPart%
Let>newfile2=C:\directory\XREF_1_%newfile%.DAT
RenameFile>oldfile,newfile2
------------------------
------------------------
best
Heres my code, this one is only working as MS, the time ill make an exe-file from it it doesnt work :
---------------------
---------------------
Let>oldfile=C:\directory\XREF.DAT
ReadLn>oldfile,3,text
MidStr>text,69,11,show
Let>rest=show
MessageModal>show
Position>\,rest,1,start
Let>start=start+1
Length>rest,lf
MidStr>rest,start,lf,temp
Position>.,temp,1,end
Let>end=end-1
MidStr>temp,1,end,midPart
Let>newfile=%midPart%
Let>newfile2=C:\directory\XREF_1_%newfile%.DAT
RenameFile>oldfile,newfile2
------------------------
------------------------
best
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Send a copy of XREF.DAT so that we can attempt to debug.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Surely it's a text file? Can't you paste it here? If you'd rather, send it to support AT mjtnet.com
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
,,,Patient Record,,,,,,,,,,,,,,,Corneal Statistics,,,,,,,,,,,,,,,Fourier Index Standard,,,,,,,Eccentricity,
File REF.,Last Name,First Name,Exam#,ID,Date&Time,Eye,Filename,SimK1,SimK1 Ang.,SimK2,SimK2 Ang.,MinK,MinK Ang.,CYL,ACP,SRI,SAI,CEI,SDP,DSI,OSI,CSI,KCI,IAI,AA,EDP,EDD,3mm Spherical Equ.,3mm Reg. Astig.,3mm Reg. Astig. Axis,3mm Asymmetry,3mm Asymmetry Axis,3mm Higher order irregularity,6mm Spherical Equ.,6mm Reg. Astig.,6mm Reg. Astig. Axis,6mm Asymmetry,6mm Asymmetry Axis,6mm Higher order irregularity,Es,Em
1,XXXXXXX,XXXXXXXXX,1,,11.05.1999 11:41:52,OD,C:\xxxxx\xxx\xxxxxxxx\I019705.TMS,52.99,77,48.76,167,48.73,169,4.23,49.35,1.75,2.61,0.85,4.10,12.45,9.74,4.07,1.00,0.67,0.63,3.72,4.19,51.51,2.41,77.26,2.56,212.27,0.53,49.43,1.60,77.09,4.04,218.08,0.51, 0.72, 0.95
This is what in the file is, so just normal txt
File REF.,Last Name,First Name,Exam#,ID,Date&Time,Eye,Filename,SimK1,SimK1 Ang.,SimK2,SimK2 Ang.,MinK,MinK Ang.,CYL,ACP,SRI,SAI,CEI,SDP,DSI,OSI,CSI,KCI,IAI,AA,EDP,EDD,3mm Spherical Equ.,3mm Reg. Astig.,3mm Reg. Astig. Axis,3mm Asymmetry,3mm Asymmetry Axis,3mm Higher order irregularity,6mm Spherical Equ.,6mm Reg. Astig.,6mm Reg. Astig. Axis,6mm Asymmetry,6mm Asymmetry Axis,6mm Higher order irregularity,Es,Em
1,XXXXXXX,XXXXXXXXX,1,,11.05.1999 11:41:52,OD,C:\xxxxx\xxx\xxxxxxxx\I019705.TMS,52.99,77,48.76,167,48.73,169,4.23,49.35,1.75,2.61,0.85,4.10,12.45,9.74,4.07,1.00,0.67,0.63,3.72,4.19,51.51,2.41,77.26,2.56,212.27,0.53,49.43,1.60,77.09,4.04,218.08,0.51, 0.72, 0.95
This is what in the file is, so just normal txt
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Ok, your script works perfectly for me, whether compiled or not. Does the same thing as an EXE as it does in script. Which is what I would expect since the interpretor is identical.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
well i have no clue now.
It works if its not compiled.
I have to check it out again tomorrow, as far as i checked it today the movefile works, copyfile i dont know, renamefile does not work....
Ill do some testings tomorrow
ill post my results then..... hope i find a way.....
Thanx for your support buy the way !!! Hope ill can count on it also tomorrow ;-)
c.u. im now going home :-)
It works if its not compiled.
I have to check it out again tomorrow, as far as i checked it today the movefile works, copyfile i dont know, renamefile does not work....
Ill do some testings tomorrow
ill post my results then..... hope i find a way.....
Thanx for your support buy the way !!! Hope ill can count on it also tomorrow ;-)
c.u. im now going home :-)