copyarr.js 661 B

1234567891011121314151617
  1. setup.qsp_copyarr = (source,target,start=0,length=undefined) => {
  2. const sourceVarname = setup.varname(source);
  3. const sourceVarname_Dict = sourceVarname + "_indexDict";
  4. const targetVarname = setup.varname(target);
  5. const targetVarname_Dict = targetVarname + "_indexDict";
  6. if(!start){
  7. const sourceValue = State.getVar(sourceVarname) ?? [];
  8. const sourceValue_Dict = State.getVar(sourceVarname_Dict);
  9. State.setVar(targetVarname, sourceValue);
  10. if(sourceValue_Dict)
  11. State.setVar(targetVarname_Dict, sourceValue_Dict);
  12. }
  13. console.error("Not implemented: setup.copyarr() with start-parameter");
  14. }