klaus Expert Licensed User Longtime User Mar 10, 2010 #1 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.
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 Longtime User Mar 10, 2010 #2 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: Mar 10, 2010
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.
klaus Expert Licensed User Longtime User Mar 10, 2010 #3 Thank you for the explanation. Of course it was noticed in the previous B4PPC versions as all variables were Strings. Best regards.
Thank you for the explanation. Of course it was noticed in the previous B4PPC versions as all variables were Strings. Best regards.