Questions regarding require #227
Replies: 3 comments
-
Posted at 2014-03-17 by Sacha Sorry, second question. When i use require in a condition like this: if(a=="extended") When i have the module on the sdcard will it be loaded at runtime if the condition is true. Memory on the board will be saved if the condition is false ? Thanks Sacha |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-17 by @gfwilliams No, the Web IDE doesn't know which modules are on the SD card so it'll load the latest module directly into Espruino anyway (and the module won't be loaded from the SD card). And yes, if you do that then the module will only be loaded if/when it is required. However because of above, the Web IDE will try and load it in. If you want to stop that happening, just make it a little harder for the Web IDE:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-17 by Sacha Hi Gordon, Many thanks for the answers. This helps a lot. Sacha |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-03-17 by Sacha
Hi Gordon,
What happens, when i have modules on the sdcard and i upload the code via the WebIDE regarding "require" ?
Will the module be loaded from the sdcard ?
Thanks
Sacha
Beta Was this translation helpful? Give feedback.
All reactions