CallSub error ?

klaus

Expert
Licensed User
I don't know if it is bug or a restriction.

I saw that the CallSub keyword accepts only String variables in the argument list. Why doesn't it accept Number variables ?

Best regards.
 

agraham

Expert
Licensed User
It's a deliberate restriction. Only Subs with 0 to 3 ByVal String parameters and a String return may be be invoked by CallSub. The reason is because of the way CallSub works in a compiled application. It uses .NET delegate types, which are a sort of pointer to a function. Each Sub signature (number and types of parameters and return type) needs its' own delegate type so the restriction limits the number of delegate types needed to four. In fact this same restriction already exists in previous versions of Basic4ppc.
 
Last edited:

klaus

Expert
Licensed User
Thank you for the explanation.
Of course it was noticed in the previous B4PPC versions as all variables were Strings.

Best regards.
 
Top