Hello Guest it is March 28, 2024, 04:51:57 AM

Author Topic: File Corrupt error  (Read 9199 times)

0 Members and 1 Guest are viewing this topic.

File Corrupt error
« on: February 05, 2010, 10:57:13 PM »
I used MachScreen to develop a screen, then used mach to edit the VB button script. I was in and out of the editor many times in Mach until I got the button script to work correctly.

I then returned to MachScreen to work on the screen and when it tried to open the file it reported the screen file was corrupt. I went back to Mach and the screen opened OK, so I went back to MachScreen and tried again. This time I clicked the button to try to open the corrupt file. It seemed to open OK, and the screen looks OK, except for the background grey seems not to fill the whole screen.

I closed and reopened the file, now it opens without the corrupt error.

Im using Mach 3.042.030 and MachScreen 1.37c
Re: File Corrupt error
« Reply #1 on: February 06, 2010, 01:44:07 AM »
Ron,
I've had the same issue between Mach and Machscreen. Klaus and I have exchanged several emails about this in the past.

I used to think it happened because I had both MS and Mach open and dealing with the same set file at the same time. It is possible to do this as MS (and Mach) does not require file locking of the set file.
I like the convenience of being able to do this - but I know it's not good programming practice - so when I get bit, I figured it's my fault.

But... in the last week I've had this happen twice when the sequence was:
Open Set in MS
edit in MS
save
close MS

start mach
load set file
edit button
<If you see mach say something like "file saved & closed" - I forget the exact messsage, Ms will think is corrupt when ms next opens the file>
close mach

open set in MS - file corrupt error.

There is no multiple program access to common data in this situation-
So I've begun to suspect that something else is also at play... but I'm not sure what.

One tip: here is a work around that I've used 100+ times in the last 4 months to recover from the situation:
DO NOT continue when MS say file corrupt - bail out instead.
Open set file in screen 4
save from screen 4
exit screen 4
Open in MS... The set file is no longer thought to be corrupt by MS.

This a very nice "feature" of screen 4! <grin>

Dave

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: File Corrupt error
« Reply #2 on: February 06, 2010, 04:58:05 AM »
Hi Dave,

could you please send me I the set-fle before and after editing in Mach3?


Klaus
The brain isn't a soap, it doesn't shrink when used.
Re: File Corrupt error
« Reply #3 on: February 06, 2010, 10:46:49 AM »
Hi Dave

I don't need the files, I could reproduce the problem and did some testing. It looks like Mach3 is not truncating the file to minimum size when saving. MachScreen compares the filesize to the last read byte  number from the set-file, if they are different, it reports the file as corrupted. If you reply "continue" the completely loaded data is shown. When you save the data, the file is truncated and when loaded the next time, there will be no corruption message. I changed that in version V1.37.d which can be downloaded.

Klaus
The brain isn't a soap, it doesn't shrink when used.
Re: File Corrupt error
« Reply #4 on: February 06, 2010, 12:29:24 PM »
Klaus -
Thanks! I hadn't reported this yet as I didn't save the files at the time it happened - so I didn't have a test case to send.
Glad you found it - one more bug gone <grin>
Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: File Corrupt error
« Reply #5 on: February 06, 2010, 06:03:40 PM »
I continued to work on my file for several hours. All the edit things I did seemed to work OK, I frequently went back and forth to Mach to test the code.

I then tried to run the code and mach gives the error "'Scripter Complie Error. In:"

If I cnage screen sets to the standard one the code runs fine. Ive tried it on 2 machines. Something in the screen set triggers this error when you ttempt to run any code.

I will attach my screen set.
Re: File Corrupt error
« Reply #6 on: February 06, 2010, 06:52:00 PM »
Looks like I may have solved teh problem- the Start button, and several others got trashed to unknown values. I corrected them, it now looks OK.

I wonder what else is trashed in the file?

I do see strange background images on all my screens except 0. There should be just a plai grey background, I see it mostly white with some grey areas.

How are you supposed to enter a system button? I thought I remembered a pull down list, the only way I can find is to enter and oem code number

thanks for all the help
Re: File Corrupt error
« Reply #7 on: February 07, 2010, 04:12:10 AM »
Hi Ron,

I've tried your screen-set, but can't get the "Scripter Compile Error" message.
On page 0 (which is the persistant page = all elements appear on all pages) you have on the left hand side a button "Text" with the function "cycle start". On page 2 you have a label with the text "Program run" without a function.
It looks to me, page 0 and page1 is a copy.
I suppose you have the background color problems with MachScreen. The actual frame size is not stored in the set-file, Mach3 sets the frame size to the windows size for development MachScreen determines the screen size in 2 ways:
1) the outest element positions build the outer frame
2) set the frame size with the frame size button. You can select for every page the size, this gives you the opportunity to see how it will like on your target system.

To enter a button select "button" in the combo box next to the "Add" button in the property dialog. Once you selected the element you can place it with the "Add" button. Depending on "options -> settings Place obj. at mouse pos" :
Place obj. at mouse button checked         when clicking the left mouse button the element is placed at the cursor pos, to place the element repeatedly, hold down the "ctrl" key and click the left mouse button
Place obj. at mouse button unchecked     when you click "Add" the element is placed on an incrementing pos from a top, left to bottom down, to place repeatedly, every left mouse button click places another element. 

Klaus
The brain isn't a soap, it doesn't shrink when used.
Re: File Corrupt error
« Reply #8 on: February 07, 2010, 05:12:57 PM »
Klaus
1.37D does not seem to fix the problem yet - here us the test case

start mach
edit button code
Used menu to do view/save current layout - mach says layout modified and stored
close mach

Open set in MS - file corrupt error
did NOT continue in MS

Open set file in Screen 4
save file
close screen 4

open set file in MS - file is fine - NO file corrupt error

Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: File Corrupt error
« Reply #9 on: February 07, 2010, 05:19:15 PM »
Hi Dave,

when you get the "file corrupted" message reply with continue yes, then save from within MachScreen. When you now load again, you shouldn't get the corrupted message.



Klaus
The brain isn't a soap, it doesn't shrink when used.