TEXT in case constraint
Hi all! I'll try string variables in CASE. But I have error - "syntax error, unexpected TEXT" function casetest(string aaa) { if aaa ~ "a1" then print "ok"; case aaa { "a1" : print "a1"; "b1" : print "b1"; else: print "not a1, nor b1"; } } Sometimes it will be comfortable. Why it is error? -- Regards, Mikhail V. Majorov
Hello! On 9/3/22 16:08, Mikhail Mayorov wrote:
function casetest(string aaa) { if aaa ~ "a1" then print "ok"; case aaa { "a1" : print "a1"; "b1" : print "b1"; else: print "not a1, nor b1"; } }
Sometimes it will be comfortable. Why it is error?
The "case" construction creates a balanced binary decision tree for fast lookup by integer value. Lookup by string isn't implemented, therefore it's an error. Patches welcome after relasing the next version of BIRD 2. If anybody wants to discuss how to implement it, just let me know by replying to this e-mail. Maria
participants (2)
-
Maria Matejka -
Mikhail Mayorov