ArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2016-12-15T12:01:03+02:00 https://brainmodular.org/forums/app.php/feed/topic/5621 2016-12-15T12:01:03+02:00 2016-12-15T12:01:03+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36459#p36459 <![CDATA[path for writing to file script]]>
Yes,

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.
textfield do save and recall their text with presets actually, man just have to check 'saved in preset' on module properties wich is off by default.

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

Statistics: Posted by 23fx23 — 15 Dec 2016, 11:01


]]>
2016-12-14T23:47:00+02:00 2016-12-14T23:47:00+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36452#p36452 <![CDATA[path for writing to file script]]>
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!!

CODE:

//////////////////////////// write text File, eric moon remix/////////////////////////// declarationconst filenameDefault = 'writeFileText.txt';  var filenameIN,folderIN,textIN &#58; Tparameter; var st   &#58; TStringList;  var filename &#58; string;                        // initialisation &#58; create parametersprocedure init;var i &#58; integer;begin                                                    textIN &#58;= CreateParam&#40;'text',ptTextField&#41;;  SetIsOutPut&#40;textIN,false&#41;;     folderIN &#58;= CreateParam&#40;'folder',ptTextField&#41;;  SetIsOutPut&#40;folderIN,false&#41;;   filenameIN &#58;= CreateParam&#40;'file name',ptTextField&#41;;  SetStringValue&#40;filenameIN,getApplicationPath + filenameDefault&#41;;  SetIsOutPut&#40;filenameIN,false&#41;;                   end;  // save procedure SaveToTextFile;begin  st.create;    st.add&#40;GetStringValue&#40;textIN&#41;&#41;;      st.SaveToFile&#40;filename&#41;;  st.free;     end;                 // Callbackprocedure callBack&#40;n&#58;integer&#41;;begin   if &#40;&#40;n = filenameIN&#41; or &#40;n = folderIN&#41;&#41; then begin        filename &#58;= getApplicationPath&#40;&#41; + 'config'         + getStringValue&#40;folderIN&#41; + ''        + GetStringValue&#40;filenameIN&#41; + '.txt';      end  else if &#40;n = textIN&#41; then begin      SaveToTextFile;   end;end;

Statistics: Posted by woodslanding — 14 Dec 2016, 22:47


]]>
2016-12-14T23:13:31+02:00 2016-12-14T23:13:31+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36450#p36450 <![CDATA[path for writing to file script]]>
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.....

Statistics: Posted by woodslanding — 14 Dec 2016, 22:13


]]>
2016-12-14T14:00:13+02:00 2016-12-14T14:00:13+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36445#p36445 <![CDATA[path for writing to file script]]>
//////////////////////////
// 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;

Statistics: Posted by oli_lab — 14 Dec 2016, 13:00


]]>
2016-12-14T11:47:23+02:00 2016-12-14T11:47:23+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36441#p36441 <![CDATA[path for writing to file script]]>
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, 10:47


]]>
2016-12-14T09:44:13+02:00 2016-12-14T09:44:13+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36440#p36440 <![CDATA[path for writing to file script]]> Statistics: Posted by 23fx23 — 14 Dec 2016, 08:44


]]>
2016-12-14T02:21:07+02:00 2016-12-14T02:21:07+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36439#p36439 <![CDATA[path for writing to file script]]>
It's in the wiki under declarations and references. There is a file section.
You could just concat the remaining CONFIG to the directory.

Statistics: Posted by sephult — 14 Dec 2016, 01:21


]]>
2016-12-14T01:44:59+02:00 2016-12-14T01:44:59+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36438#p36438 <![CDATA[path for writing to file script]]>
Is there a way to point it to the home directory of HH, rather than using an absolute path?

Like to read and write to/from the HH directory somewhere, preferably within CONFIG.....

Statistics: Posted by woodslanding — 14 Dec 2016, 00:44


]]>
BrainModular BrainModular Users Forum 2016-12-15T12:01:03+02:00 https://brainmodular.org/forums/app.php/feed/topic/5621 2016-12-15T12:01:03+02:00 2016-12-15T12:01:03+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36459#p36459 <![CDATA[path for writing to file script]]>
Yes,

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.
textfield do save and recall their text with presets actually, man just have to check 'saved in preset' on module properties wich is off by default.

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

Statistics: Posted by 23fx23 — 15 Dec 2016, 11:01


]]>
2016-12-14T23:47:00+02:00 2016-12-14T23:47:00+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36452#p36452 <![CDATA[path for writing to file script]]>
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!!

CODE:

//////////////////////////// write text File, eric moon remix/////////////////////////// declarationconst filenameDefault = 'writeFileText.txt';  var filenameIN,folderIN,textIN &#58; Tparameter; var st   &#58; TStringList;  var filename &#58; string;                        // initialisation &#58; create parametersprocedure init;var i &#58; integer;begin                                                    textIN &#58;= CreateParam&#40;'text',ptTextField&#41;;  SetIsOutPut&#40;textIN,false&#41;;     folderIN &#58;= CreateParam&#40;'folder',ptTextField&#41;;  SetIsOutPut&#40;folderIN,false&#41;;   filenameIN &#58;= CreateParam&#40;'file name',ptTextField&#41;;  SetStringValue&#40;filenameIN,getApplicationPath + filenameDefault&#41;;  SetIsOutPut&#40;filenameIN,false&#41;;                   end;  // save procedure SaveToTextFile;begin  st.create;    st.add&#40;GetStringValue&#40;textIN&#41;&#41;;      st.SaveToFile&#40;filename&#41;;  st.free;     end;                 // Callbackprocedure callBack&#40;n&#58;integer&#41;;begin   if &#40;&#40;n = filenameIN&#41; or &#40;n = folderIN&#41;&#41; then begin        filename &#58;= getApplicationPath&#40;&#41; + 'config'         + getStringValue&#40;folderIN&#41; + ''        + GetStringValue&#40;filenameIN&#41; + '.txt';      end  else if &#40;n = textIN&#41; then begin      SaveToTextFile;   end;end;

Statistics: Posted by woodslanding — 14 Dec 2016, 22:47


]]>
2016-12-14T23:13:31+02:00 2016-12-14T23:13:31+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36450#p36450 <![CDATA[path for writing to file script]]>
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.....

Statistics: Posted by woodslanding — 14 Dec 2016, 22:13


]]>
2016-12-14T14:00:13+02:00 2016-12-14T14:00:13+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36445#p36445 <![CDATA[path for writing to file script]]>
//////////////////////////
// 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;

Statistics: Posted by oli_lab — 14 Dec 2016, 13:00


]]>
2016-12-14T11:47:23+02:00 2016-12-14T11:47:23+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36441#p36441 <![CDATA[path for writing to file script]]>
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, 10:47


]]>
2016-12-14T09:44:13+02:00 2016-12-14T09:44:13+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36440#p36440 <![CDATA[path for writing to file script]]> Statistics: Posted by 23fx23 — 14 Dec 2016, 08:44


]]>
2016-12-14T02:21:07+02:00 2016-12-14T02:21:07+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36439#p36439 <![CDATA[path for writing to file script]]>
It's in the wiki under declarations and references. There is a file section.
You could just concat the remaining CONFIG to the directory.

Statistics: Posted by sephult — 14 Dec 2016, 01:21


]]>
2016-12-14T01:44:59+02:00 2016-12-14T01:44:59+02:00 https://brainmodular.org/forums/viewtopic.php?t=5621&p=36438#p36438 <![CDATA[path for writing to file script]]>
Is there a way to point it to the home directory of HH, rather than using an absolute path?

Like to read and write to/from the HH directory somewhere, preferably within CONFIG.....

Statistics: Posted by woodslanding — 14 Dec 2016, 00:44


]]>