Author Topic: I got a syntax bug today. What am I doing wrong?  (Read 6036 times)

0 Members and 1 Guest are viewing this topic.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
I got a syntax bug today. What am I doing wrong?
« on: March 08, 2018, 06:32:06 pm »
So I made a sub, and I wanted to preserve a variable. So I coded...

SUB mysub
STxAxTIC

... and it gave me a syntax error. It's a real head scratcher, but it does prove the IDE doesn't like STxAxTIC.

Pete :D

Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline codeguy

  • Forum Regular
  • Posts: 174
    • View Profile
Re: I got a syntax bug today. What am I doing wrong?
« Reply #1 on: March 08, 2018, 10:32:18 pm »
TRY
Code: QB64: [Select]
  1. SUB RePete
  2. STATIC STxAxTIC
  3.  
This will help cure your STxAxTIC cling.
:) :) :)

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: I got a syntax bug today. What am I doing wrong?
« Reply #2 on: March 08, 2018, 11:43:47 pm »
LOL@STxAxTIC cling!

I actually did have to check the wiki today for STATIC. It's been forever since I used it in a sub. Anyway, I got a C++ compiler failure message, so I had to double check it. The syntax was right, STATIC, but I forgot I had pasted in a data block. It was pasted after a SUB, which of course caused the compiler error. Fixed that and everything was fine, but I'm not going to miss an opportunity to blame it on STxAxTIC! Please note I only bug you when I'm out of sorts.

Pete :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: I got a syntax bug today. What am I doing wrong?
« Reply #3 on: March 09, 2018, 03:10:11 am »
So I made a sub, and I wanted to preserve a variable. So I coded...

SUB mysub
STxAxTIC

... and it gave me a syntax error. It's a real head scratcher, but it does prove the IDE doesn't like STxAxTIC.

Pete :D


You forgot to add END SUB. ;D
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: I got a syntax bug today. What am I doing wrong?
« Reply #4 on: March 09, 2018, 03:19:41 am »
I tried...

END SNUB

...but I got another syntax error. Go figure.

Pete :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Prithak

  • Newbie
  • Posts: 56
  • Life itself is a Programming Language!
    • View Profile
    • My Programming Language
Re: I got a syntax bug today. What am I doing wrong?
« Reply #5 on: March 18, 2018, 09:16:00 am »
I tried...

END SNUB

...but I got another syntax error. Go figure.

Pete :D
Do you even QB64 bro?????
CLS
IF computer$ = "ON" THEN
me$ = "Happy!"
ELSE
me$ = "Time To Draw!"
END IF
END

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: I got a syntax bug today. What am I doing wrong?
« Reply #6 on: March 18, 2018, 11:39:51 am »
I tried...

END SNUB

...but I got another syntax error. Go figure.

Pete :D
Do you even QB64 bro?????

The bro is only coding in BALL these days, BALL is acronym for Beginner All-purpose Laughing Laughing....

Have a ball (with a wink)  ;D

 

Offline Prithak

  • Newbie
  • Posts: 56
  • Life itself is a Programming Language!
    • View Profile
    • My Programming Language
Re: I got a syntax bug today. What am I doing wrong?
« Reply #7 on: March 18, 2018, 12:26:31 pm »
I tried...

END SNUB

...but I got another syntax error. Go figure.

Pete :D
Do you even QB64 bro?????

The bro is only coding in BALL these days, BALL is acronym for Beginner All-purpose Laughing Laughing....

Have a ball (with a wink)  ;D
LOL!!!
CLS
IF computer$ = "ON" THEN
me$ = "Happy!"
ELSE
me$ = "Time To Draw!"
END IF
END

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: I got a syntax bug today. What am I doing wrong?
« Reply #8 on: March 18, 2018, 04:19:17 pm »
I tried...

END SNUB

...but I got another syntax error. Go figure.

Pete :D
Do you even QB64 bro?????

I've dabbled in QB /QB64 but I doubt I have produced much more than one or so million lines of code. Next time I'm picking a language that "Hello World!" can be produced with far less work. Now if you will excuse me, March is "r" month. Hello Wor...

Pete  :D

LOL@Basic All-Purpose Laughter Language
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Prithak

  • Newbie
  • Posts: 56
  • Life itself is a Programming Language!
    • View Profile
    • My Programming Language
Re: I got a syntax bug today. What am I doing wrong?
« Reply #9 on: March 18, 2018, 10:28:46 pm »
I tried...

END SNUB

...but I got another syntax error. Go figure.

Pete :D

Do you even QB64 bro?????

I've dabbled in QB /QB64 but I doubt I have produced much more than one or so million lines of code. Next time I'm picking a language that "Hello World!" can be produced with far less work. Now if you will excuse me, March is "r" month. Hello Wor...

Pete  :D

LOL@Basic All-Purpose Laughter Language
Try C++ xD!

But DAMN!!! Someone SHOULD make the BALL language (Beginner All-Purpose Laughter Language)
CLS
IF computer$ = "ON" THEN
me$ = "Happy!"
ELSE
me$ = "Time To Draw!"
END IF
END