Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, _ ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long Declare Function RegQueryValueEx Lib "advapi32.dll" Alias"RegQueryValueExA" _ (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long,_ lpType As Long, lpData As Any, lpcbData As Long) As Long Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long Const HKEY_CURRENT_USER = &H80000001 'The HKEY_CURRENT_USER base key, which stores program information for the current user. Const HKEY_LOCAL_MACHINE = &H80000002 'The HKEY_LOCAL_MACHINE base key, which stores program information for all users. Const HKEY_USERS = &H80000003 'The HKEY_USERS base key, which has all the information for any user (not just the one provided by HKEY_CURRENT_USER). Const HKEY_CURRENT_CONFIG = &H80000005 'The HKEY_CURRENT_CONFIG base key, which stores computer configuration information. Const HKEY_DYN_DATA = &H80000006 Const KEY_READ = &H20019 Function ReadRegistryLong(key As Long, subkey As String, ByVal nomine As String) As Long Dim hregkey As Long ' receives handle to the newly created or opened registry key Dim stringbuffer As Long ' receives data read from the registry Dim slength As Long ' receives length of returned data Dim retval As Long ' return value ' Set the name of the new key and the default security settings retval = RegOpenKeyEx(key, subkey, 0, KEY_READ, hregkey) ' Read the "username" string from the registry key. Note how in Visual Basic the string must be passed ' using the ByVal keyword. 'stringbuffer = Space(255) ' make room in the buffer to receive the information slength = 4 '255 ' this must be set if passing a string to the function retval = RegQueryValueEx(hregkey, nomine, 0, 1, stringbuffer,slength) ' read data 'stringbuffer = Left(stringbuffer, slength) ' extract the returned data from the buffer ' Close the registry key retval = RegCloseKey(hregkey) ReadRegistryLong = stringbuffer End Function Function GMTAdjustment As Long ' ' Purpose: To read from the registry the difference that must be added to ' local time to Get Greenwich Mean Time '______________________________________________________________________ Dim key As Long Dim subkey As String Dim retval As Long ' Set the name of the desired key key = HKEY_LOCAL_MACHINE subkey = "System\CurrentControlSet\control\TimeZoneInformation" nomine = "ActiveTimeBias" retval = ReadRegistryLong(key,subkey,nomine) GMTAdjustment = 60.0 * retval End Function Function QuidToDate(q As String) As Date Dim qq As String Dim secs As Long Dim secs0 As Long Dim ThisYear As Integer Dim years As Long Dim days As Integer ' ' Number of seconds since the beginning of time, January 1, 1970 ' qq = left(q,Len(q) - 4) secs = Val("&H" + qq) - GMTAdjustment secs0 = secs ' ' Number of days since the beginning of time, January 1, 1970, ' Dim spd As Long spd = 24.0*3600.0 'Seconds per day spy = 365.0*spd 'Seconds per year sply = spy + spd 'Seconds per leap year spq = 3.0*spy +sply 'Seconds per quadyear Dim quadyears As Integer Dim zot As Double Dim Remd As Double Dim remyears As Integer Dim days1970 As Long days1970 = Int(secs/spd) ' ' Adjust days since December 31, 1899, Rosescript's beginning of Time. ' Dim days00 As Long days00 = 1.0 + 2.0 * 365 ' 1900, not a leap year + 1969 days00 = days00 + 17*(365.0*4 + 1.0) ' 1901 - 1968 Dim d As Date d = days1970 + days00 + 1 ' Last full day + 1 = today ' ' The time, dude, the time! ' Dim s0 As Date Dim xx As Double xx = secs/spd - days1970 ' Don't need the excess days. s0 = xx + d quidToDate = s0 End Function Sub Main viewport.open viewport.clear Dim cc As classCollection Dim c As class Set cc = Roseapp.currentmodel.getallclasses For i = 1 To cc.count Set c = cc.getat(i) Print c.name, QuidToDate(c.getUniqueID) Next i End Sub