Machine UUID (was Re: Creating a unique number / ID in Omnis Studio_
Mike Matthews - Omnis
omnis at lineal.co.uk
Wed Feb 1 10:21:57 UTC 2023
Hello All,
I need to find/make a UUID for a machine to identify it. I could use MAC address, but each network connection has a different number.
I could generate one, using process described in earlier email.
Or I could see if the hardware has one, ie, the logic board / CPU, if such a number exists.
How does anybody identify a particular PC, uniquely?
Thanks
Mike Matthews
Lineal Software Solutions
Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>
omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>
www.lineal.co.uk<http://www.lineal.co.uk/>
www.sqlworks.co.uk<http://www.sqlworks.co/>
On 18 Nov 2022, at 16:00, Nick Renders <omnis1 at arcict.com<mailto:omnis1 at arcict.com>> wrote:
Caution: This is a message which has originated from outside the organisation. Ensure the sender is trusted and the content is safe before opening links or attachments.
Hi guys,
Thanks for all the replies!
I don't know why I was so hesitant to use a global counter, but that does solve my problem.
I have a standard object class called oProperties (our own TMObjs, you might say ;-) so it makes sense to create a $nextID method there with a Class Variable to ensure no overlap.
Cheers,
Nick
On 18 Nov 2022, at 15:22, Doug Easterbrook via omnisdev-en wrote:
hi Nick.
I’m going to assume that there is a temporary number (never saves in a database) and local to a machine. In other words, If you add a line to a list, you want a unique number in that list. if you restart omnis, you can start again at 1, and there is no need to refer to that same number on another machine.
I”m assuming tyhat, because #CT is unique to a machine and starts at zero if you restart the machine.
if so, I’d suggest making a class variable (if the number can be unique to a window) or a task var if the number is to be unique to all lists in all windows.
so.
task var ID integer 64 bit initial Value 0
and make a small method in your startup task called ‘$nextID’ that you can refer to in your $add
do list.$add($ctask.$nextID,rest of variables)
and $nextID is
calculate ID as ID 1
quit method ID
just replace any use of #CT with the $ctask.$nextID function call
that way you don’t need to change the variable type within your lists if you went with timestamps or UUID’s or what have you. Your existing code should just work.
it seems to me that all you are doing is serializing your lines in your list locally.
Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.artsman.com&c=E,1,HJ0TNO73vjOO5SnAjPUwvpHEU8uvkZuGafwENUrfRVlEoqeaDYm8Qp-JLatjE0aADUgUdEaaFJ3snYGlFisjuNUeTAwd4vAyZ7wOpsRarBKHpjp6kb05RdId-cuA&typo=1
Phone (403) 650-1978
On Nov 18, 2022, at 5:38 AM, Nick Renders <omnis1 at arcict.com> wrote:
Hi List,
I was wondering if anyone had any good tips when it comes to creating unique numbers or IDs in Omnis?
For instance, to identify a specific row in a List variable whose number of lines is constantly changing (with $addbefore, $addafter, and $remove).
I have been using #CT (number of ticks) but technology has caught up, and now there are situations with duplicate values because the calculations are done in the same 1/60th of a second.
Any suggestions?
Thanks,
Nick Renders
_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,xDjatTXEhf16jG_XYGcelLGGbH2uXXt010Urg_1bDehIJlgswmfrteufYdwLWe7FpOVHQr-hd6C4tp-yVgREVw2xNM_YiX4QZ_pb9TckTQ,,&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,35rnTFqAg8PqjecOIliQzCGkIX-ed2Rv8wdNk1sgL4hdAqZ4RvmlaSxBWwHRXmxCUm4Ucx7FMjy9wojF3jaaBtu6UQp065NxQD9iQSW7hQdg8x-E&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,Ly0W7gz-sYHjjDz1iIHOw8O9qU7PjE6mj870NQh6o6g8lFbhytaBcJALFgKdANribmFIQXggB43Sw7w0_HnBeYRoHMfTE-a7-R5qLUsVuDBhkAOTx6u5&typo=1
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list