Hi Ron,
Maybe the attached codes-nippet is useful to you. It is an example of stateful programming, which isn't compliant with the functional programming concept but, in some cases, can be very useful.
Hopes it helps, Rob Stapper
PS. put the module-file in a subdirectory: "counter", in your basex-repo-directory.
-----Oorspronkelijk bericht----- Van: basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] Namens Ron Katriel Verzonden: dinsdag 20 oktober 2015 15:43 Aan: Christian Grün CC: BaseX Onderwerp: Re: [basex-talk] Generating consecutive integers in a for loop
Thanks, Christian. I will give it a try.
With regards to the GUI, is there a .dmg for the Mac? The BaseX website directs to brew but it appears this implies using the GUI that comes in the jar. I tried it recently but it did not work properly (was unable to type into it).
Thanks, Ron
On Oct 20, 2015, at 9:33 AM, Christian Grün christian.gruen@gmail.com wrote:
Hi Ron,
This may help:
for $doc at $pos in db:open('clinicaltrials') return insert node attribute id { $pos } into $doc/*
([XQST0049] Duplicate declaration of static variable $root.).
This may be due to a minor GUI error in the 8.3 release; it was already fixed in the latest snapshot [2].
Hope this helps, Christian
[1] https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg069 60.html [2] http://files.basex.org/releases/latest
Thanks, Ron
declare variable $root := <root count="0"/>;
declare function local:getuid () as xs:integer { let $count := $root/@count return ( insert node <node id='{ $count }'/> into $root, replace value of node $count with $count + 1 ) };
On October 19, 2015 at 5:12:19 PM, meumapple (meumapple@gmail.com) wrote:
Hi Christian,
I think there is a bug for Mac (10.x). Those options do no work and typing quotes is really difficult. First I need to press the button twice in order for one quote to appear. Then whatever button I use the other quote appears. And there are other strange behaviors which are difficult to detail (eg the cursor is moved outside adjacent quotes if the option "automatically add characters" is on).
Whitespaces cannot be shown, only new line character (this happens also on a windows machine).
Joseph
ps I also notice that running basexgui and basex.jar are different. I added saxon9he.jar in the lib folder and it is read by basexgui but not by basex.jar. Moreover basexgui sometimes runs out of memory when basex.jar does not. Does this make sense?
Il giorno 19/ott/2015, alle ore 14:02, Christian Grün christian.gruen@gmail.com ha scritto:
Hi Joseph,
I love using the gui but I have a hard time dealing with autocomplete: is there a way to disable it in the txt editor?
You can disable "Automatically add characters" in the Preferences dialog. Could you please detail which autocompletions are particularly confusing for you?
I think that it would also be very useful to allow view of whitespaces and tabs and have a function to prettify the code itself (do you know any for xquery?)
Tabs and non-breaking spaces are visualized when activating "Show invisible characters" in that same dialog.
--- Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. https://www.avast.com/antivirus