[solved]I found a new reserved keyword :-)

General FreeBASIC programming questions.
D.J.Peters
Posts: 7191
Joined: May 28, 2005 3:28

[solved]I found a new reserved keyword :-)

Postby D.J.Peters » Nov 02, 2017 4:06

Code: Select all

print "error: bepp makes no BEEP!"
bepp : sleep : end 1
Last edited by D.J.Peters on Nov 02, 2017 18:24, edited 1 time in total.
paul doe
Posts: 199
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: I found a new reserved keyword :-)

Postby paul doe » Nov 02, 2017 4:42

Pretty hilarious haha. Was it a typo? =D
D.J.Peters
Posts: 7191
Joined: May 28, 2005 3:28

Re: I found a new reserved keyword :-)

Postby D.J.Peters » Nov 02, 2017 5:07

bepp = big endian pixel point :-)
dkl
Site Admin
Posts: 3174
Joined: Jul 28, 2005 14:45
Location: Germany

Re: I found a new reserved keyword :-)

Postby dkl » Nov 02, 2017 6:17

That feels familiar...

Code: Select all

foobar: print "foobar" : sleep 1000, 1
goto foobar
sancho3
Posts: 57
Joined: Sep 30, 2017 3:22

Re: I found a new reserved keyword :-)

Postby sancho3 » Nov 02, 2017 8:10

So the verdict is that bepp : is being taken as a label?
I tried xxxxxxxxxxxbepp : and it reports no error also.
And then tested (ugly code):

Code: Select all

print "error: bepp makes no BEEP!"
bepp : print "yes its a label": sleep :

dim as string k
do
   k = inkey
   if k = " " then
      goto bepp
   elseif k = chr(27) then
      exit do
   endif
   sleep 2
   
loop
fxm
Posts: 7492
Joined: Apr 22, 2009 12:46
Location: Paris suburb, FRANCE

Re: I found a new reserved keyword :-)

Postby fxm » Nov 02, 2017 8:58

Yes, a label.
(because a symbol at the first column of line and ending with a colon)
D.J.Peters
Posts: 7191
Joined: May 28, 2005 3:28

Re: I found a new reserved keyword :-)

Postby D.J.Peters » Nov 02, 2017 18:23

Cool I found a label ;-)

I never used goto and labels with FreeBASIC.

Joshy
D.J.Peters
Posts: 7191
Joined: May 28, 2005 3:28

Re: I found a new reserved keyword :-)

Postby D.J.Peters » Nov 03, 2017 5:01

D.J.Peters wrote:I never used goto and labels with FreeBASIC.
What a big lie !

Last time I used GOTO was for the MultiPut 2.0 code: viewtopic.php?f=7&t=24479

Joshy

Return to “General”

Who is online

Users browsing this forum: Lost Zergling and 1 guest