2011-04-20 76 views
4

在KRL中是否有内置函数用于生成UUID(或类似的)的GUID?在KRL中生成GUID/UUID

+0

现在还没有一个专门的GUID或UUID功能,但也有可能适合您需求的东西。你有特殊的格式吗? – TelegramSam 2011-04-20 16:16:23

回答

4

我已经创建了一个包,可能抱着你在web服务模块:UUID Module

使用像这样:

ruleset a8x165 { 
    meta { 
     name "UUID Module Example" 
     description << 
      Example use of the UUID Module 
     >> 
     author "Sam Curren" 
     logging off 
     use module a8x164 alias uuid 
    } 

    dispatch {} 

    global {} 

    rule first_rule { 
     select when pageview ".*" setting() 
     pre { 
      testuuid = uuid:new_uuid(); 
     } 
     notify("Hello World", "This is a UUID: #{testuuid}"); 
    } 
} 
+0

适合我。谢谢一堆! – 2011-04-21 16:05:22