lispprologpicolisp

Autogenerated keys in Pilog


What's the best way to go about autogenerated keys for Pilog? i've been digging around a bit and can't find anything related.

Hints and pointers would be most appreciated. Thank you.


Solution

  • You get the same behavior as auto increment in for instance MySQL with this one: http://software-lab.de/doc/refG.html#genKey

    I use it a lot in the VizReader code.

    I'm not so sure I would've used it much though if I had know about the (id) function from the start: http://software-lab.de/doc/refI.html#id

    In my case it's all about displaying a nice id that is easy to relate for humans and JavaScript in my non-traditional gui and as you can see both approaches accomplish that but that latter is imo more elegant.

    /Henrik Sarvell

    (Copied verbatim form Henrik Sarvells' answer.)