Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GUID/UUID generator suggestions
#1
Gintaras, Morning!

A few questions per GUID/UUID:

1) Am I understanding the help system correctly that Q-Macros DOES NOT generate it's own GUID, but that it goes on-line and obtains one thru Google?

2) If this is the case, what is the downside of using a portable generator? (Such as 'unique identifier generator' (http://portableapps.com/apps/utilities/ ... r_portable)). Are there any other 'portable' generators that you would suggest?

The reason I would like to use a 'portable' version, is because of 'speed' and the macro having to wait for the Internet connection.

3) I will be using the GUID as a a 'transaction-ID', much like a Pri-Key. Do you have any important suggestions on doing this w. QM's that are not included in the help system?

and

4) Could you provide a short example of:
a. the creation of a GUID or UUID
b. convert this to a string
c. and places this string in a variable

AND 'ONCE AGAIN', -thank you for your help!!!

Kent
#2
Where it is in the help system?

The simplest GUID generator in QM is
Macro Macro2816
Code:
Copy      Help
str s.Guid
out s

If need binary, use Windows API directly:
GUID g
CoCreateGuid(&g)

I am 99,99% sure it does not use the Internet.
#3
Gintaras,

Wow! that was easy!

You asked 'if need binary'. For what I am using it for, somewhat like a Primary-Key, DO I NEED THE BINARY? I mean, what are the odds that this generated string will ever be duplicated on my personal desktop?

ALSO, could you provide an example of using the Windows API directly? That includes generating a string as the "s.Guid" does?

Gintaras, I guess you hear this a lot, but I AM NOT a programmer but a 'literature person' and I write macros that relates to 'caQDAs' (Computer Assisted Qualitative Data Analysis) and although my question MAY BE super elementary, your help IS ALWAYS WONDERFULLY HELPFUL and totally appreciated!!!!

Kent
#4
Quote:what are the odds that this generated string will ever be duplicated on my personal desktop
Microsoft etc say 0, I don't know.

Quote:ALSO, could you provide an example of using the Windows API directly? That includes generating a string as the "s.Guid" does?
Look in Guid function source code. Click the Guid word and press F2.
#5
Gintaras,

When I attempt:

GUID g
int r=CoCreateGuid (&g)
FromGUID (g)
ret r

I get a 'Error in xxx: unknow identifier'

AND the 'FromGUID' is not in blue text as it is in the System folder for 'str.Guid'

Why does this not see this as blue?
#6
Because FromGUID is a str member function, it can be called either from another str member function or with a str variable like
Macro Macro2818
Code:
Copy      Help
GUID g
int r=CoCreateGuid(&g)
str s.FromGUID(g)
out s
it is the same as
Macro Macro2818
Code:
Copy      Help
str s.Guid
out s
#7
Thanks again! and if you have just a moment, please provide a very short answer on 'what is the difference between' generating a GUID with or without the binary?
#8
CoCreateGuid creates binary GUID, then FromGUID converts it to string.
#9
BUT why would one generally need the binary form? (short reply in behalf of your time!)
#10
Most Windows API functions use binary format.
#11
Gintaras, I guess MY REAL QUESTION HERE = does using the 'binary' form provide for a more useful or 'powerful' treatment of the GUID by Quick Macros? Such as searching, distinguishing, etc.?
#12
No, you need it when using Windows API functions that need GUID.
#13
THANKS!


Forum Jump:


Users browsing this thread: 1 Guest(s)