Code snippets are added into b4xlibs. You can create an empty b4xlib just for snippets.
Each snippet is a text file, for example:
B4X:
'Loads the remote media into the given panel and sets the background color.
$MediaManager$.SetMediaWithExtra($Panel$, "https://www.b4x.com/images/Logo_on-dark.png", "", _
CreateMap($MediaManager$.REQUEST_BACKGROUND: xui.Color_Black))
Creating a bank of code snippets is a matter of:
1. Putting all snippets (text files) in a folder named Snippets.
2. Zipping the folder and renaming it to CodeSnippets.b4xlib (or any other name).
Creating a bank of code snippets is a matter of:
1. Putting all snippets (text files) in a folder named Snippets.
2. Zipping the folder and renaming it to CodeSnippets.b4xlib (or any other name).
So will I be able to have a single library with all my snippets? And, if so, how should/could I group them, for example by genre (graphics, strings, web, ...), to select one in the best, most direct way?
I really hope I'm not the only one who doesn't understand how it works ?
So will I be able to have a single library with all my snippets? And, if so, how should/could I group them, for example by genre (graphics, strings, web, ...), to select one in the best, most direct way?
This is, in my opinion, a superfluous library.
This is always possible with a code module.
Just put all code-snipped in the module. I use it in every new app as a general module.
The only advantage would be that you can save different layouts in this library.
how to change the image file size from the originally large server to small size? so that when loading multiple images the process becomes faster I use SMM and Panel to display the image MediaManager.SetMediaWithExtra(PanelImage, https://.......,"", CreateMap(MediaManager.REQUEST_RESIZE_MODE ...
www.b4x.com
MindBlowing... will just wait until the suspense is over...
These are code snippets, not complete methods. Think of it as keyboard shortcuts that expand to more complete code. Or macros/macro expansion. I've seen this requested before...
You can store lines of code that you use regularly, or can't remember completely and copy it into your code with a few keystrokes. It could be a java class name, or 1 or more lines or a full sub. Whatever you like.
You can store lines of code that you use regularly, or can't remember completely and copy it into your code with a few keystrokes. It could be a java class name, or 1 or more lines or a full sub. Whatever you like.
Ahh.. so it is like snippets managers made available by members, but instead of using another B4J jar or exe, we get it inside the ide itself. So no copy+paste or drag+paste required. Okay.
I really hope I'm not the only one who doesn't understand how it works ?
So will I be able to have a single library with all my snippets? And, if so, how should/could I group them, for example by genre (graphics, strings, web, ...), to select one in the best, most direct way?
I suppose I have not paid that much attention. My doubt was if I could add more than one code snippets in the given (everytime) library in a single file. But it is already mentioned. We cannot.
Sorry, my bad, by saying file I meant the text file in the b4xlib file with snippets and with the "given (everytime) library" I meant f.e. JsonObject or XMLSax etc. So my question was if we want to add more than one code snippets for JsonObject f.e. can we put them all in a single txt file or several txts one for each code snippet? It is already answered as I understand. That is one snippet per txt.