@d-healey it works, thank you
Posts made by deniskorg
-
RE: How to ignore file.loadAsObjec(), if file is not a valid json
And David...maybe I'm wrong somewhere but if i use this
const ARR_TEST = [1, 2, 3];
if(ARR_TEST.length !== 3)
Console.print("test");but if i use this it work
if(parseInt(ARR_TEST.length) !== 3)
Console.print("test"); -
RE: How to ignore file.loadAsObjec(), if file is not a valid json
i use return -1 :)) because this check func is used in other func and and i get numbers for diff errors, and other things
/// This if statement isn't needed
if (typeof file !== "object" || file == undefined || file == null) return -1;I thought it was a problem for that file and that's why I was getting an error at loadAsObject,
but your version is a working method ... with loadAsString , and after parseAsJson,THANK YOU
-
RE: How to ignore file.loadAsObjec(), if file is not a valid json
thank you David ,
local s = file.loadAsString();
local obj = s.parseAsJSON();if i use this it work
-
RE: How to ignore file.loadAsObjec(), if file is not a valid json
and for more context this is in the invalid file :
{
"bankCC": [
-1
-1
]
}that comma is missing
-
RE: How to ignore file.loadAsObjec(), if file is not a valid json
parseInt(objFile.bankCC.length) == 0 for this... i need to use parse int, only in that way is work
is a bug or ? -
RE: How to ignore file.loadAsObjec(), if file is not a valid json
inline function checkFileAssignBankCC(file) { if(!file.isFile()) return -1; if(typeof file !== "object" || file == undefined || file == null) return -1; local objFile = file.loadAsObject(); if (!isDefined(objFile)) objFile = ""; if(!isDefined(objFile.bankCC)) return -1; if(parseInt(objFile.bankCC.length) == 0 || parseInt(objFile.bankCC.length) !== 14) return -1; for(i = 0; i < objFile.bankCC.length; i++) { if(typeof i !== "number") return -1; }; return true; };
-
RE: How to ignore file.loadAsObjec(), if file is not a valid json
not working
... I also tried this option, and I get the same error on the line where loadAsObject is -
How to ignore file.loadAsObjec(), if file is not a valid json
local objFile = file.loadAsObject() == null ? "" : file.loadAsObject();
in this example, if user use a file is not valid json, my code can't ignore that file...
i get a syntax error "settingsGlobBankAssignCC.js (26): 11:5: error: Expected ',' or ']'
and i want if file is not a valid json , get a empty string...and recreate that file...
Hope I made myself understood. -
copy a directory folder
Is it possible to copy a directory folder? With that file API, I can only copy individual files.
-
RE: Note Release - randomly gets stuck
@deniskorg said in Note Release - randomly gets stuck:
@Adam_G I had a similar problem with stuck notes in flstudio, my solution, in options-audio settings , check allign tick length...for me it worked
by checking that option you will also avoid the problem with some notes that were skipped when a midi is played
-
RE: Note Release - randomly gets stuck
@Adam_G I had a similar problem with stuck notes in flstudio, my solution, in options-audio settings , check allign tick length...for me it worked