Fundamentals Capstone ex 2.2

https://learninghub.kx.com/forums/topic/fundamentals-capstone-ex-2-2

I literally do not know why it keeps sending me types mismatch error. Is there any reference link about what types mismatch error means. have been encountering types errors every time, but every time the issue came from different contexts which are a bit frustrating.

Hi when I try to run your function I get a error “brokerID” not a types mismatch. Here’s a few things I noticed:

  • brokerID should be brokerId on the last line of function

  • if is incorrect here:

  • if function checks is statement true: then executes all subsequent statements if true.
  • if the statement is false: do not evaluate the subsequent statements and continue to the next q expression.
  • It seems you are trying to do if-else here - have a look at conditional evaluation using $
- question asks for result to be returned in type long - not string (need to cast here)
  • colon in wrong place on the last line

I would recommend the Fundamentals courses to learn the basics on Execution Control - using if and if-else

 

extractBrokerId:{[exMsg] parts: “-” vs exMsg; exch: parts 0; $[exch like “CME*”; brokerId:parts 2; brokerId: parts 1]; :“J”$brokerId}