help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Edit problem Octave


From: PetrSt
Subject: Re: Edit problem Octave
Date: Thu, 14 Mar 2013 08:20:02 -0700 (PDT)

I experienced similar problem on W7 pointing to line:
system (sprintf (FUNCTION.EDITOR, cstrcat ("\"", fileandpath, "\"")),[],
FUNCTION.MODE);
I tried command "editor file"  (eg. notepad++ d:\name.m) in windows command
prompt (cmd), which produced the error, as well as with the full path to
editor. In contrary, cmd command fullpath\editor (e.g. c:\Program Files
(x86)\Notepad++\notepad++.exe launches notepad++. So it should be problem
with cmd search path instead of edit.m. Also it could be confirmed by using
notepad as the editor, because it works without errors as the notepad is
recognized by cmd as valid command with file as argument. Bellow is a code,
witch I'm using now, ofcourse without edit.m checks and other
functionalities.

function editfile(file)
        edidx = 1;
        editorloc = {'c:\\Program Files (x86)\\Notepad++\\';...
                                'c:\\Windows\\System32\\';...
                                'c:\\Program Files\\Windows 
NT\\Accessories\\';...
                                'c:\\Program Files (x86)\\GUIOctave\\bin\\'};
        editor = {'notepad++';...
                        'notepad';...
                        'wordpad';...
                        'OctaveEditor'};
        mode = 'async'; %'sync';        %
        
        origdir = pwd();
        file = strrep(file,'\','\\');
        cd(editorloc{edidx});
        system(sprintf('%s %s',editor{edidx},file),[],mode);
        cd(origdir);
end     %editfile



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Edit-problem-Octave-tp4648888p4650790.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]