|
strategy control panel function panelSave
#460677
07/10/16 09:31
07/10/16 09:31
|
Joined: Apr 2014
Posts: 24
yebit
OP
Newbie
|
OP
Newbie
Joined: Apr 2014
Posts: 24
|
Using Zorros S 1.44.1 problem: when saving changes to a control panel, Zorro clears all special panel characters that designate whether a cell is f.i a button or editable. the panel file:
Hours,@
short hours,#2
medium hours,#8
long hours,#16
,@
Periods,@
short period,#3
medium period,#9
long period,#27
longest period,#2
,@
bar period (hours),#4
,!Save
Then Zorro code:
static string panelfile = "History\\testpanel.csv";
void click(int row, int col) {
panelSave(panelfile);
}
function run() {
if (is(INITRUN)) {
panel(panelfile,GREY,100);
}
}
the effect of clicking the panel cell button (with the "save" text) results in the following file contents:
Hours,
short hours,2
medium hours,8
long hours,16
,
Periods,
short period,3
medium period,9
long period,27
longest period,2
,
bar period (hours),4
,Save
which disables the save button and makes each formerly editable cells read only, allowing a one time only changing of stored values. Does anyone know of a way to keep the original panel formatting when using the panelSave function?
|
|
|
Re: strategy control panel function panelSave
[Re: jcl]
#460729
07/12/16 03:30
07/12/16 03:30
|
Joined: Apr 2014
Posts: 24
yebit
OP
Newbie
|
OP
Newbie
Joined: Apr 2014
Posts: 24
|
Not entirely true. From the manual: panelLoad (string filename) Loads the panel content in .csv format from the given file. Only editable or button cells are affected.
panel (string filename, int color, int size) Opens a control panel with the structure and content from a .csv spreadsheet file. etc
Those definitions should be for all intents and purposes synonymous, unless the intention is to obfuscate. What's more, replacing panel() with panelLoad() results in nothing, no visible panel, so is a less useful, in practice, function than panel(). It is the panelSave() that is removing the formatting in the csv file. I've moved on in the meantime to using the file_content() function and a configuration file.
|
|
|
|