Re: New switch/case idea
- Posted by Kat Apr 01, 2009
- 1850 views
This is simple, easily read, plain, works great:
switch sendheader[idx][1] do case "GET": tempheader &= sendheader[idx][1] & sendheader[idx][2] & sendheader[idx][3] & " " & httpversion & "\r\n" break -- append the http version and flatten case "POST": tempheader &= sendheader[idx][1] & sendheader[idx][2] & sendheader[idx][3] & " " & httpversion & "\r\n" break -- append the http version and flatten case else tempheader &= sendheader[idx][1] & sendheader[idx][2] & sendheader[idx][3] & "\r\n" -- else just flatten the sequence end switch
Switch doesn't need anything else except range, or executeable case. It doesn't need "with/out fallthru", "then", "do", "continue", etc.
useless