[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interesting issue around function calls defined with a space after the name


Le 14/10/2025 à 16:22, Brian G a écrit :
I have never encountered this behavior before.......

When calling a programmatic function , a space after the name causes no issues. But for built in functions it causes an error?

In the ide, if you leave a space after most built in functions it fixes it, but not for shl or shr.

But in a script you can leave a space after any function.

Those functions  defined in and by the application have no issues with a space after the name and before the opening (.

Only build in functions fail in scripts with a space between the Name and the opening (.

The IDE corrects the issue after leaving the line by removing the spaces so it does not by default show up in most IDE based programs as the reformat takes care of it...

except apparently, shr and shl... there may be more examples. It can be confusing for a programmer when the errors show up and the code looks correct.

I wonder if the behavior should more consistently ignore the space between the function name and the opening ( ?

Dim a As Integer = 1
a = testit  (3)                                           ' this works correctly a = Shl  (a, 1)                                          ' this creates an error and the IDE does not fix it up
               ^ Unexpected Shl
print format(a,"#####0")

sub testit(value as integer) as integer
   print "yes", value * 4
   return 3*4
end


Shr and Shl are operators too, not just functions. This is why they do not eat the space after them.

P.S. By the way, answer to the mailing-list, not just me.

Regards,

--
Benoît Minisini.