Yes, it looks like that is correct.That is one snippet per txt.
Yes, it looks like that is correct.That is one snippet per txt.
Yes I know; or, rather, I hope so ?. I'm already happy to feel less stupid ?All will become clear when we get our hands on it
'Loop.txt file in B4XLib: Code_Maps
'Iterates with respect to keys in a map.
For Each $varName$ As String In $mapName$.Keys
Next
'Initialize.txt file in B4XLib: Code_Lists
'Declares and initializes an empty list.
Dim $listName$ As List
$listName$.Initialize
Well, like in this gif...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?
Well, like in this gif...
View attachment 146140
you don't necessarily have to start by writing "Code..."
so it will be sufficient to create your text files (the snippets) in such a way that you can filter them, if they are all part of a single library.
I mean, for example, my string snippets will probably have names like: str_RemoveSpaces and by just typing "str_" I can more easily select what I want to insert.
(I answered myself ?)
why this is bad ?but one text file per snippet, that's enough to stop me even trying it
I understand your doubts but if you prepare a Snippets folder with the text files inside, keep it like this but compress it (7-zip or similar) in your own MySnippets.b4xlib (just change the extension) it is quite convenient.I like the idea of the snippets, but one text file per snippet, that's enough to stop me even trying it. (Sorry Erel)
So, my snippet looks like this:[OK]...Now the bad news... we must re-write all the threads with the snippets and change the "variables" with $variable$ !!!, and preferable at the first post attach a txt file snippet ! ?
Private Sub Delete$Controller$ (id As Long)
' #Version = v2
' #Desc = Delete $Controller$ in MinimaList
' #Elements = [":id"]
If id < 1 Then
HRM.ResponseError = "Invalid id value"
HRM.ResponseCode = 404
Else
Dim Index As Int = Main.$MinimaList$.IndexFromId(id)
If Index < 0 Then
HRM.ResponseError = "$Controller$ not found"
HRM.ResponseCode = 404
Else
Main.$MinimaList$.Remove(Index)
HRM.ResponseCode = 200
End If
End If
If Main.SimpleResponse Then
WebApiUtils.ReturnSimpleHttpResponse(HRM, "List", Response)
Else
WebApiUtils.ReturnHttpResponse(HRM, Response)
End If
If Main.KVS_ENABLED Then Main.WriteKVS("$MinimaList$", Main.$MinimaList$)
End Sub
I really like the simplicity of using text files... at the end... no-one "stops" you to create a DB-snippet-editor that will automatically export/manage the text files...