ArrayArrayArrayArrayArrayArrayArrayArray
Statistics: Posted by 23fx23 — 15 Dec 2016, 11:01 CODE: Statistics: Posted by woodslanding — 14 Dec 2016, 22:47 Statistics: Posted by woodslanding — 14 Dec 2016, 22:13 Statistics: Posted by oli_lab — 14 Dec 2016, 13:00 Statistics: Posted by sephult — 14 Dec 2016, 10:47
To be clear, before I disappear down this rabbit hole, is there no way to store string data per preset using the existing usine preset system?
I tried with the basic text widgets, but their text data is not stored with the preset.
text pannel don't, but alternatively, as text is array, adding an array display or set out of any text element will be saved/recall in preset
]]>
Here's a more useful script than the default, which will try to write to a folder you probably don't have permission for, which makes it a poor example!
thanks all!!//////////////////////////// write text File, eric moon remix/////////////////////////// declarationconst filenameDefault = 'writeFileText.txt'; var filenameIN,folderIN,textIN : Tparameter; var st : TStringList; var filename : string; // initialisation : create parametersprocedure init;var i : integer;begin textIN := CreateParam('text',ptTextField); SetIsOutPut(textIN,false); folderIN := CreateParam('folder',ptTextField); SetIsOutPut(folderIN,false); filenameIN := CreateParam('file name',ptTextField); SetStringValue(filenameIN,getApplicationPath + filenameDefault); SetIsOutPut(filenameIN,false); end; // save procedure SaveToTextFile;begin st.create; st.add(GetStringValue(textIN)); st.SaveToFile(filename); st.free; end; // Callbackprocedure callBack(n:integer);begin if ((n = filenameIN) or (n = folderIN)) then begin filename := getApplicationPath() + 'config' + getStringValue(folderIN) + '' + GetStringValue(filenameIN) + '.txt'; end else if (n = textIN) then begin SaveToTextFile; end;end;
]]>
To be clear, before I disappear down this rabbit hole, is there no way to store string data per preset using the existing usine preset system?
I tried with the basic text widgets, but their text data is not stored with the preset.
Hmmm, maybe a list where the preset recalls the line associated with that preset.....??
might end up being more complicated than scripting, with a number of different text elements.....
]]>
//////////////////////////
// write text File
/////////////////////////
// declaration
const filenameDefault = 'c:speak.txt';
var fname,input : Tparameter;
var st : TStringList;
// save
procedure SaveToTextFile;
begin
st.create;
st.add(GetStringValue(input));
st.SaveToFile(GetStringValue(fname));
st.free;
end;
// Callback
procedure callBack(n:integer);
begin
SaveToTextFile;
end;
// initialisation : create parameters
procedure init;
var i : integer;
begin
Input := CreateParam('in',ptTextField);
SetIsOutPut(Input,false);
fname := CreateParam('file name',ptTextField);
SetStringValue(fname,filenameDefault);
SetIsOutPut(fname,false);
end;
]]>
I've also run into that same problem.
I've had other oddities besides file writing putting Usine in my program files folders too.
Since then I've always ran direct desktop, at the root in a folder, or on an external drive.
Another side-note is that if you raise the administrative privileges you run into drag and drop problems between applications.
-s
]]>
Statistics: Posted by sephult — 14 Dec 2016, 01:21
Statistics: Posted by woodslanding — 14 Dec 2016, 00:44
Statistics: Posted by 23fx23 — 15 Dec 2016, 11:01
CODE:
//////////////////////////// write text File, eric moon remix/////////////////////////// declarationconst filenameDefault = 'writeFileText.txt'; var filenameIN,folderIN,textIN : Tparameter; var st : TStringList; var filename : string; // initialisation : create parametersprocedure init;var i : integer;begin textIN := CreateParam('text',ptTextField); SetIsOutPut(textIN,false); folderIN := CreateParam('folder',ptTextField); SetIsOutPut(folderIN,false); filenameIN := CreateParam('file name',ptTextField); SetStringValue(filenameIN,getApplicationPath + filenameDefault); SetIsOutPut(filenameIN,false); end; // save procedure SaveToTextFile;begin st.create; st.add(GetStringValue(textIN)); st.SaveToFile(filename); st.free; end; // Callbackprocedure callBack(n:integer);begin if ((n = filenameIN) or (n = folderIN)) then begin filename := getApplicationPath() + 'config' + getStringValue(folderIN) + '' + GetStringValue(filenameIN) + '.txt'; end else if (n = textIN) then begin SaveToTextFile; end;end;Statistics: Posted by woodslanding — 14 Dec 2016, 22:47
Statistics: Posted by woodslanding — 14 Dec 2016, 22:13
Statistics: Posted by oli_lab — 14 Dec 2016, 13:00
Statistics: Posted by sephult — 14 Dec 2016, 10:47
Statistics: Posted by sephult — 14 Dec 2016, 01:21
Statistics: Posted by woodslanding — 14 Dec 2016, 00:44