Show messages: All
1
2-6
From: Michael Gibson
Hi Frederick,
re:
> Is this because the file list does not support the form as used for the
> directory list - for (var d in dirlist)?
Yes, here the dirlist variable is a native JavaScript Array that was created by the JavaScript runtime.
The files variable is a MoiList object created by Moi,
Until recently in v5 objects that were created by Moi did not support the for ( propname in object ) syntax.
Since v5 Mar-29-2023, the for ( propname in object ) syntax is now supported on objects created by MoI but it doesn't have the special behavior for JavaScript arrays.
It's generally considered a best practice to use a regular for () loop with an index variable to loop through the contents of an array and not for ... in .
Some info here:
https://stackoverflow.com/questions/5263847/javascript-loops-for-in-vs-for
https://www.geeksforgeeks.org/javascript/why-using-for-in-for-array-iteration-a-bad-idea-in-javascript/
- Michael
From: fcwilt
Hi Michael,
Interesting.
So it doesn't work anything like the 'for in" I use in Delphi. There the programmer gets to/has to code the class enumerator and thus "for in" can do exactly what he wants it to.
Over the years I am often bemused at some of the things that Java and JavaScript do.
Thanks for the references as well.
Frederick
From: wayne hill (WAYNEHILL5202)
Use JavaScript version ES5 if generating code for MoI3d from AI.
Wayne
From: fcwilt
Hi Wayne.
So AI can generate code?
How does it know what to do?
Thanks.
Frederick
From: Frenchy Pilou (PILOU)
Of course Ai can generate code about anything! :)
But you must manage it with some Q&R! :)
Send an image or/ and text who explain that you want in any domains!
I have absolutely no knowledge ot the five or more languages used! (Htlml, Css, render, JavaScript etc...
Here a little headache for play with it! :) Just fill the screen with same form who can be Rotated or Mirrored! ;)
Free Claude was used ... it can of course gives the answer but better oneself to seach by pleasure!
https://moiscript.weebly.com/jeux.html
Show messages: All
1
2-6