Problems with standalonebuilder of Rev.2.7.3.?

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Aug 19 06:55:03 EDT 2006


Hi Martin,

My first thought is that it is not the standalone builder which  
causes the problem. If you suspect something is wrong with the path,  
why don't you just include a check for that in your scripts?

   if there is a file thePathToYourFile then
     -- read data etc
   else
     beep
     answer error "Sorry, the file could not be found."
   end if

Probably, correct error handling may help you here. You could check  
the result after each attempt to access a file. I assume that the  
sliders don't work because the data is not loaded correctly, while  
you don't check that the file could be accessed and correct data has  
been read.

If you check the result after each attempt to access the file, you  
should have a script like this:

function readData theFile,theIdentifier
   open file theFile for read
   put the result into rslt
   read from file theFile until EOF
   if the result is not empty them put cr & the result after rslt
   close file theFile
   if rslt is not empty then
     return "Error:" & cr & rslt -- error 1
   else
     put it into myData
     if char 1 to length(theIdentifier) of myData is theIdentifier then
       return myData
     else
       set the itemDel to slash
       return "Error: the file" && last item of theFile && ¬
       "cannot be read." -- error 2
     end if
   end if
end readData

This is just an example. You can alter the check for correct data in  
any feasible way, e.g. by checking the number of lines in a file or  
the presence of a particular string. If error 1 occurs, you may want  
to check that the path tot he file is correct or possibly that the  
defaultfolder or directory has been set correctly. If error 2 occurs,  
maybe something went wrong when you copied the files to the intel  
Mac. In the case of the latter, you might want to compare the files  
on both computers:

on test
   answer file "Choose a file..."
   if it is not empty then
     put it into myFile
     open file myFile for binary read
     read from file myFile until EOF
     put it into fld 1
     close file myFile
   end if
end test

Include this script in a new stack with 1 field and run the script.  
Choose the file when the file dialog appears and open it. Do this on  
both computers and see if there is any difference.

If the test that appears in the text fields, you should probably do a  
test with the sliders. Do the sliders work if you make a new stack,  
save the thumbPos values to a file, reset the sliders, open the file  
again and set the thumbPos values using the data from the file? If  
not, which script do you use to set the thumbPositions?

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Salery is the easiest way to set up your own web store: http:// 
www.salery.biz/salery.html


Op 18-aug-2006, om 18:36 heeft Martin Meili het volgende geschreven:

> Hi
> I've got a stack I can tax my students in terms of different  
> language skills with (sliders, text fields in combination with  
> sliders). The program runs very fast on my PowerPC, OS 10.3.9. I  
> store the data of each student in textfiles. They are reloadable in  
> my taxation panel.
>
> If I use Revolution 2.7.2  and have a standalone for the intel-32  
> processor built , the program runs sufficiently, that means, it's  
> slower than on the PowerPC, but every feature of the program works  
> as I want it to do.
>
> If I use Revolution 2.7.3, it seems to be faster, but storing data  
> doesn't work anymore. There must be something wrong with the path,  
> and the sliders in combination with the textfields don't work  
> anymore. You can enter data into the texfields using the ask  
> dialogue, but the thumbposition of the sliders don't change.
>
> What's wrong here? Has anybody had the same or other problems with  
> the Rev.2.7.3. standalone builder?
>
> Martin
>




More information about the use-livecode mailing list