How to check command line arguments in a kdb script? -


i want check number of command arguments in q script , return error message if .z.x doesn't match intended number of arguments. far came line:

if[count .z.x < 4; '`badusage] "arguments ok" 

i never past if statement, returns `badusage, regardless of number of arguments i'm using.

how check correct number of arguments, print error message , exit script?

its because statements evaluated right left. .z.x < 4 evaluated first, , count of result.

q)count .z.x < 4 0 q)4 > count .z.x 1b 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -