I'm looking for a way to generate an unique string inside the viewer, in similar manner to the uniqid() function of the php programming language, where it's assured the uniqueness of the variable based on the current time.I already made something like that by using a start number that's passed trough the javascript interface, however this approach is external to the viewer and error prone.
Hope there's a way to do it...
Thanks a lot.
Create unique identifier inside the viewer
-
-
Include an xml that is dynamic.
-
Hi,
in the most cases using the runtime in milliseconds plus a random value can be used for generation an unique name...
e.g.
Codemul(tmp, random, 10000); roundval(tmp); txtadd(varname, 'var_', get(timertick), '_', get(tmp)); set(get(varname), ...);
additionally also a counter could be used, that will be increased on each call...
see also:
https://krpano.com/docu/actions/#timertick
https://krpano.com/docu/actions/#randombest regards,
Klaus
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!