ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
Statistics: Posted by Fléau — 08 Mar 2013, 11:23 Statistics: Posted by nay-seven — 17 May 2011, 10:02 CODE: Statistics: Posted by 23fx23 — 17 May 2011, 09:56 Statistics: Posted by nay-seven — 17 May 2011, 07:55
please, could you take a few minutes to add a "memtypes" array input?
That would be great, thanks in advance.
Edit: forget it,
was really easy and simple to patch.
]]>
thanks again
]]>
or if you already made assign and don't wanna loose them, add the line in init after arrayout creation://////////////////////////// MX_MULTIMODES_ 23fx15/05/2K11// allow to configure cells to act as// momentary/toggle swich or group swiches/////////////////////////// parameters declarationvar Config,MXsize:tparameter;var Ctype:tparameter;var arrayout,MEMtypes:tparameter;var IDclic:tparameter;var Msdwn:tparameter;var L, cty,ID: integer;var msd,cfg:boolean;// initialisation : create parametersprocedure init;begin MXsize:=createParam('Mxsize',ptdatafield);setisoutput(Mxsize,false); Config:=createParam('config',ptswitch);setisoutput(config,false);ctype:=createParam('ctype',ptListBox);SetListBoxString(ctype,'button,swich,G1,G2,G3,G4,G5,G6,G7,G8');setisoutput(ctype,false);idclic:=createParam('idclic',ptdatafield);setisoutput(idclic,false);msdwn:=createParam('msdwn',ptdatafield);setisoutput(msdwn,false);arrayout:=createParam('arrayout',Ptarray);setisinput(Arrayout,false);setdontsave(arrayout,false);MemTypes:=createParam('Memtypes',Ptarray);setisinput(Memtypes,false);setdontsave(memtypes,false);id:=0;msd:=false;cfg:=false;end;// Callback procedureProcedure Callback(N:integer); beginif (n=mxsize) then resize;if (n=config) then begin cfg:=getvalue(config)=1; end;if (n=idclic) then begin if getvalue(idclic)>-1 then begin ID:= trunc(getvalue(idclic)); end; end;if (n=msdwn) then begin MSD:=getvalue(msdwn)=1; if MSD then begin //resize; if CFG then begin setdataarrayvalue(memtypes,ID,getvalue(ctype)); end; cty:= trunc(getdataarrayvalue(memtypes,ID)); end;//msd U_CELLS(cty); end;//msdwn end;////////////////////////////Procedure U_CELLS(mode : integer);var i:integer;beginif mode=0 then begin //button,mmt mode setdataarrayvalue(arrayout,ID,getvalue(msdwn)); end; if (mode=1) and (MSD) then begin setdataarrayvalue(arrayout,ID,1-getdataarrayvalue(arrayout,ID)); end;if mode>=2 then begin for i:=0 to L-1 do begin if getdataarrayvalue(memtypes,i)=mode then begin setdataarrayvalue(arrayout,i,0); end; end; setdataarrayvalue(arrayout,id,1); end;end;/////////////////////////Procedure RESIZE;beginL:=trunc(getvalue(Mxsize));setlength(arrayout,L);setlength(memtypes,L);end;//////////////////////////
setdontsave(arrayout,false); then make 'reload script'
]]>
]]>
Statistics: Posted by 23fx23 — 15 May 2011, 18:02
Statistics: Posted by nay-seven — 15 May 2011, 17:24
CODE:
//////////////////////////// MX_MULTIMODES_ 23fx15/05/2K11// allow to configure cells to act as// momentary/toggle swich or group swiches/////////////////////////// parameters declarationvar Config,MXsize:tparameter;var Ctype:tparameter;var arrayout,MEMtypes:tparameter;var IDclic:tparameter;var Msdwn:tparameter;var L, cty,ID: integer;var msd,cfg:boolean;// initialisation : create parametersprocedure init;begin MXsize:=createParam('Mxsize',ptdatafield);setisoutput(Mxsize,false); Config:=createParam('config',ptswitch);setisoutput(config,false);ctype:=createParam('ctype',ptListBox);SetListBoxString(ctype,'button,swich,G1,G2,G3,G4,G5,G6,G7,G8');setisoutput(ctype,false);idclic:=createParam('idclic',ptdatafield);setisoutput(idclic,false);msdwn:=createParam('msdwn',ptdatafield);setisoutput(msdwn,false);arrayout:=createParam('arrayout',Ptarray);setisinput(Arrayout,false);MemTypes:=createParam('Memtypes',Ptarray);setisinput(Memtypes,false);setdontsave(memtypes,false);id:=0;msd:=false;cfg:=false;end;// Callback procedureProcedure Callback(N:integer); beginif (n=mxsize) then resize;if (n=config) then begin cfg:=getvalue(config)=1; end;if (n=idclic) then begin if getvalue(idclic)>-1 then begin ID:= trunc(getvalue(idclic)); end; end;if (n=msdwn) then begin MSD:=getvalue(msdwn)=1; if MSD then begin //resize; if CFG then begin setdataarrayvalue(memtypes,ID,getvalue(ctype)); end; cty:= trunc(getdataarrayvalue(memtypes,ID)); itrace(cty); end;//msd U_CELLS(cty); end;//msdwn end;////////////////////////////Procedure U_CELLS(mode : integer);var i:integer;beginif mode=0 then begin //button,mmt mode setdataarrayvalue(arrayout,ID,getvalue(msdwn)); end; if (mode=1) and (MSD) then begin setdataarrayvalue(arrayout,ID,1-getdataarrayvalue(arrayout,ID)); end;if mode>=2 then begin for i:=0 to L-1 do begin if getdataarrayvalue(memtypes,i)=mode then begin setdataarrayvalue(arrayout,i,0); end; end; setdataarrayvalue(arrayout,id,1); end;end;/////////////////////////Procedure RESIZE;beginL:=trunc(getvalue(Mxsize));setlength(arrayout,L);setlength(memtypes,L);end;//////////////////////////or an already wired patch here:Statistics: Posted by 23fx23 — 15 May 2011, 16:46
Statistics: Posted by 23fx23 — 15 May 2011, 15:44

Statistics: Posted by nay-seven — 15 May 2011, 15:33
Statistics: Posted by nay-seven — 15 May 2011, 15:28
Statistics: Posted by Fléau — 08 Mar 2013, 11:23
Statistics: Posted by nay-seven — 17 May 2011, 10:02
CODE:
//////////////////////////// MX_MULTIMODES_ 23fx15/05/2K11// allow to configure cells to act as// momentary/toggle swich or group swiches/////////////////////////// parameters declarationvar Config,MXsize:tparameter;var Ctype:tparameter;var arrayout,MEMtypes:tparameter;var IDclic:tparameter;var Msdwn:tparameter;var L, cty,ID: integer;var msd,cfg:boolean;// initialisation : create parametersprocedure init;begin MXsize:=createParam('Mxsize',ptdatafield);setisoutput(Mxsize,false); Config:=createParam('config',ptswitch);setisoutput(config,false);ctype:=createParam('ctype',ptListBox);SetListBoxString(ctype,'button,swich,G1,G2,G3,G4,G5,G6,G7,G8');setisoutput(ctype,false);idclic:=createParam('idclic',ptdatafield);setisoutput(idclic,false);msdwn:=createParam('msdwn',ptdatafield);setisoutput(msdwn,false);arrayout:=createParam('arrayout',Ptarray);setisinput(Arrayout,false);setdontsave(arrayout,false);MemTypes:=createParam('Memtypes',Ptarray);setisinput(Memtypes,false);setdontsave(memtypes,false);id:=0;msd:=false;cfg:=false;end;// Callback procedureProcedure Callback(N:integer); beginif (n=mxsize) then resize;if (n=config) then begin cfg:=getvalue(config)=1; end;if (n=idclic) then begin if getvalue(idclic)>-1 then begin ID:= trunc(getvalue(idclic)); end; end;if (n=msdwn) then begin MSD:=getvalue(msdwn)=1; if MSD then begin //resize; if CFG then begin setdataarrayvalue(memtypes,ID,getvalue(ctype)); end; cty:= trunc(getdataarrayvalue(memtypes,ID)); end;//msd U_CELLS(cty); end;//msdwn end;////////////////////////////Procedure U_CELLS(mode : integer);var i:integer;beginif mode=0 then begin //button,mmt mode setdataarrayvalue(arrayout,ID,getvalue(msdwn)); end; if (mode=1) and (MSD) then begin setdataarrayvalue(arrayout,ID,1-getdataarrayvalue(arrayout,ID)); end;if mode>=2 then begin for i:=0 to L-1 do begin if getdataarrayvalue(memtypes,i)=mode then begin setdataarrayvalue(arrayout,i,0); end; end; setdataarrayvalue(arrayout,id,1); end;end;/////////////////////////Procedure RESIZE;beginL:=trunc(getvalue(Mxsize));setlength(arrayout,L);setlength(memtypes,L);end;//////////////////////////or if you already made assign and don't wanna loose them, add the line in init after arrayout creation:Statistics: Posted by 23fx23 — 17 May 2011, 09:56
Statistics: Posted by nay-seven — 17 May 2011, 07:55
Statistics: Posted by 23fx23 — 15 May 2011, 18:02
Statistics: Posted by nay-seven — 15 May 2011, 17:24
CODE:
//////////////////////////// MX_MULTIMODES_ 23fx15/05/2K11// allow to configure cells to act as// momentary/toggle swich or group swiches/////////////////////////// parameters declarationvar Config,MXsize:tparameter;var Ctype:tparameter;var arrayout,MEMtypes:tparameter;var IDclic:tparameter;var Msdwn:tparameter;var L, cty,ID: integer;var msd,cfg:boolean;// initialisation : create parametersprocedure init;begin MXsize:=createParam('Mxsize',ptdatafield);setisoutput(Mxsize,false); Config:=createParam('config',ptswitch);setisoutput(config,false);ctype:=createParam('ctype',ptListBox);SetListBoxString(ctype,'button,swich,G1,G2,G3,G4,G5,G6,G7,G8');setisoutput(ctype,false);idclic:=createParam('idclic',ptdatafield);setisoutput(idclic,false);msdwn:=createParam('msdwn',ptdatafield);setisoutput(msdwn,false);arrayout:=createParam('arrayout',Ptarray);setisinput(Arrayout,false);MemTypes:=createParam('Memtypes',Ptarray);setisinput(Memtypes,false);setdontsave(memtypes,false);id:=0;msd:=false;cfg:=false;end;// Callback procedureProcedure Callback(N:integer); beginif (n=mxsize) then resize;if (n=config) then begin cfg:=getvalue(config)=1; end;if (n=idclic) then begin if getvalue(idclic)>-1 then begin ID:= trunc(getvalue(idclic)); end; end;if (n=msdwn) then begin MSD:=getvalue(msdwn)=1; if MSD then begin //resize; if CFG then begin setdataarrayvalue(memtypes,ID,getvalue(ctype)); end; cty:= trunc(getdataarrayvalue(memtypes,ID)); itrace(cty); end;//msd U_CELLS(cty); end;//msdwn end;////////////////////////////Procedure U_CELLS(mode : integer);var i:integer;beginif mode=0 then begin //button,mmt mode setdataarrayvalue(arrayout,ID,getvalue(msdwn)); end; if (mode=1) and (MSD) then begin setdataarrayvalue(arrayout,ID,1-getdataarrayvalue(arrayout,ID)); end;if mode>=2 then begin for i:=0 to L-1 do begin if getdataarrayvalue(memtypes,i)=mode then begin setdataarrayvalue(arrayout,i,0); end; end; setdataarrayvalue(arrayout,id,1); end;end;/////////////////////////Procedure RESIZE;beginL:=trunc(getvalue(Mxsize));setlength(arrayout,L);setlength(memtypes,L);end;//////////////////////////or an already wired patch here:Statistics: Posted by 23fx23 — 15 May 2011, 16:46
Statistics: Posted by 23fx23 — 15 May 2011, 15:44

Statistics: Posted by nay-seven — 15 May 2011, 15:33
Statistics: Posted by nay-seven — 15 May 2011, 15:28