[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
[Thread Prev] | [Thread Next]
- Subject: Re: Interesting issue around function calls defined with a space after the name
- From: Brian G <brian@xxxxxxxxxxxxxxxx>
- Date: Tue, 14 Oct 2025 19:23:33 -0700
- To: user@xxxxxxxxxxxxxxxxxxxxxx
On 10/14/25 10:21, Benoît Minisini wrote:
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 = 1a = 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 endShr and Shl are operators too, not just functions. This is why they do not eat the space after them.
Yes Granted, but for instance a space after Format also causes the same error, seems any built in function has this issueP.S. By the way, answer to the mailing-list, not just me. Regards,
# Gambas Project File 3.0 Title=Gambas Script Startup=MMain Vendor=Ordinary Version=0.0.1 License=General Public License 2.0 # Gambas module file : MMain:6:13: format 1 :' Gambas module file 2 : 3 :Public Sub main() 4 :' #!/usr/bin/env gbs3 5 :dim a as integer = 3 6*:print format (a,"####0") ^ Unknown identifier: format 7 :End # Gambas Project File 3.0 Title=Gambas Script Startup=MMain Vendor=Ordinary Version=0.0.1 License=General Public License 2.0 # Gambas module file : MMain:6:10: abs 1 :' Gambas module file 2 : 3 :Public Sub main() 4 :' #!/usr/bin/env gbs3 5 :dim a as integer = 3 6*:print abs (a) ^ Unknown identifier: abs 7 :End -- ~~~~ Brian
Attachment:
OpenPGP_0x78BFB26402F48419.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
| Interesting issue around function calls defined with a space after the name | Brian G <brian@xxxxxxxxxxxxxxxx> |
| Re: Interesting issue around function calls defined with a space after the name | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |