2011-04-20 77 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