Problem for open a standalone from a CdRom

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 5:12 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Tue Jul 12, 2011 5:25 pm

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
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Tue Jul 12, 2011 5:53 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem for open a standalone from a CdRom

Post by Klaus » Tue Jul 12, 2011 6:21 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by jmburnod » Wed Jul 13, 2011 11:38 am

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 ?
https://alternatic.ch

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Problem for open a standalone from a CdRom

Post by SparkOut » Wed Jul 13, 2011 3:49 pm

FrankyH simply copied some text already on the forum and used it to make a post that planted Spam in his signature.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Problem for open a standalone from a CdRom

Post by Mark » Wed Jul 13, 2011 4:04 pm

Yes, I replied to the question about FrankyH already, but I think a moderator took out my answer :-(

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem for open a standalone from a CdRom

Post by Klaus » Wed Jul 13, 2011 4:17 pm

Hi Mark,

I only removed the Spammers posting!


Best

Klaus

Post Reply