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

[sc-dev] windows



<x-tad-smaller>
The only difference between these two methods is that one calls openTextFile and the other calls openWinTextFile.
Platform differences like this must not percolate up through methods or it will become a plague. Another solution must be found.

openCodeFile {
</x-tad-smaller><x-tad-smaller>var</x-tad-smaller><x-tad-smaller> string, class, method, words;
string = interpreter.cmdLine;
if (string.includes($-), {
words = string.delimit({ </x-tad-smaller><x-tad-smaller>arg</x-tad-smaller><x-tad-smaller> c; c == $- });
class = words.at(0).asSymbol.asClass;
if (class.notNil, {
method = class.findMethod(words.at(1).asSymbol);
if (method.notNil, {
method.filenameSymbol.asString.openTextFile(method.charPos, -1);
});
});
},{
class = string.asSymbol.asClass;
if (class.notNil, {
class.filenameSymbol.asString.openTextFile(class.charPos, -1);
});
});
}

openWinCodeFile {
</x-tad-smaller><x-tad-smaller>var</x-tad-smaller><x-tad-smaller> string, class, method, words;
string = interpreter.cmdLine;
if (string.includes($-), {
words = string.delimit({ </x-tad-smaller><x-tad-smaller>arg</x-tad-smaller><x-tad-smaller> c; c == $- });
class = words.at(0).asSymbol.asClass;
if (class.notNil, {
method = class.findMethod(words.at(1).asSymbol);
if (method.notNil, {
method.filenameSymbol.asString.openWinTextFile(method.charPos, -1);
});
});
},{
class = string.asSymbol.asClass;
if (class.notNil, {
class.filenameSymbol.asString.openWinTextFile(class.charPos, -1);
});
});
}
</x-tad-smaller>

--
james mccartney
http://www.audiosynth.com