Page 2 of 2

Re: Problem for open a standalone from a CdRom

Posted: Tue Jul 12, 2011 5:12 pm
by Mark
Hi Jean-Marc,

In the entire script that you posted, there is no single read or put url command. Perhaps you should post that part of the script.

Kind regards,

Mark

Re: Problem for open a standalone from a CdRom

Posted: Tue Jul 12, 2011 5:25 pm
by jmburnod
Hi Mark,

There is the old script when an error coming

Code: Select all

on ImpPref
   global gPathNec
   put gPathNec&"/"&MesPrefs into LeFi
   put ReadUnFi(LeFi) into bufPref
   set the monmodenav of this stack to(line 1 of bufPref)
   set the defdelai of this stack to(line 2 of bufPref)
   set the MonParleurTexte of this stack to(line 3 of bufPref)
   set the MonParleurInfos of this stack to(line 4 of bufPref)
end ImpPref

function ReadUnFi pF --•• read a file, pF = filename
   put pF into PathFi
   put empty into rReadUnFi
   open file PathFi 
   read from file PathFi until eof
   put it into rReadUnFi
   close file PathFi
   return rReadUnFi
end ReadUnFi
Best

Jean-Marc

Re: Problem for open a standalone from a CdRom

Posted: Tue Jul 12, 2011 5:53 pm
by Mark
Jean-Marc,

This doesn't work:

Code: Select all

to(line 1 of bufPref)
and should be changed into

Code: Select all

to (line 1 of bufPref)
Mind the space. All following lines containing similar syntax need to be changed, too.

It would also be useful to change the first part of the script into:

Code: Select all

  global gPathNec
  put gPathNec&"/"&MesPrefs into LeFi
  if there is a file LeFi then
    put ReadUnFi(LeFi) into bufPref
  else
    beep
    answer error "Can't find file" && LeFi
  end if
Kind regards,

Mark

Re: Problem for open a standalone from a CdRom

Posted: Tue Jul 12, 2011 6:21 pm
by Klaus
Bonsoir Jean-Marc,

additionally to Marks suggestions you should also change this in your function:

Code: Select all

function ReadUnFi pF --•• read a file, pF = filename
   put pF into PathFi
   put empty into rReadUnFi
   
   ## !!!
   open file PathFi FOR READ
   ## !!

   read from file PathFi until eof
   put it into rReadUnFi
   close file PathFi
   return rReadUnFi
end ReadUnFi
Or use the URL syntax, which is also much shorter :D

Code: Select all

function ReadUnFi pF --•• read a file, pF = filename
   return URL("file:" & pF)
end ReadUnFi
Best

Klaus

Re: Problem for open a standalone from a CdRom

Posted: Wed Jul 13, 2011 11:38 am
by jmburnod
Hi Mark and Klaus
Thank again for your suggestions and i'll change my scripts.
I believe that the problem is somewhere else. But i repeat, the problem is solved with a file on the HD instead the CD-Rom.
I give some news later.

Kinds regards
Jean-Marc

P.S I posted yesterday the same text as FrankyH. It is possible ?

Re: Problem for open a standalone from a CdRom

Posted: Wed Jul 13, 2011 3:49 pm
by SparkOut
FrankyH simply copied some text already on the forum and used it to make a post that planted Spam in his signature.

Re: Problem for open a standalone from a CdRom

Posted: Wed Jul 13, 2011 4:04 pm
by Mark
Yes, I replied to the question about FrankyH already, but I think a moderator took out my answer :-(

Mark

Re: Problem for open a standalone from a CdRom

Posted: Wed Jul 13, 2011 4:17 pm
by Klaus
Hi Mark,

I only removed the Spammers posting!


Best

Klaus