Author Topic: You learn something new every decade...  (Read 4535 times)

0 Members and 1 Guest are viewing this topic.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
You learn something new every decade...
« on: December 17, 2020, 03:42:47 pm »
I was surprised this worked, putting a conditional IF/THEN inside a SELECT CASE, without making it a case!

Code: QB64: [Select]
  1.     DO
  2.         _LIMIT 30
  3.         b$ = INKEY$
  4.     LOOP UNTIL LEN(b$)
  5.  
  6.     SELECT CASE b$
  7.         IF UCASE$(b$) = "A" THEN
  8.             PRINT "A, look at this!"
  9.             b$ = "" ' Note this WON'T avoid CASE ELSE.
  10.         END IF
  11.  
  12.         CASE "1"
  13.             PRINT "one..."
  14.         CASE "2"
  15.             PRINT "two..."
  16.         CASE ELSE
  17.             PRINT "else..."
  18.     END SELECT
  19. LOOP UNTIL b$ = CHR$(27)

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

FellippeHeitor

  • Guest
Re: You learn something new every decade...
« Reply #1 on: December 17, 2020, 03:44:16 pm »
Lol, that shouldn’t have worked, I suppose 😂

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: You learn something new every decade...
« Reply #2 on: December 17, 2020, 07:02:10 pm »
Fascinating. Now I'm wondering if this can be something that can be relied upon...

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: You learn something new every decade...
« Reply #3 on: December 17, 2020, 07:22:10 pm »
I wouldn't go there. Nothing to see here folks, don't pay attention to that man behind the curtain.
You're not done when it works, you're done when it's right.

FellippeHeitor

  • Guest
Re: You learn something new every decade...
« Reply #4 on: December 17, 2020, 07:31:18 pm »
Yeah. Don't do it.

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: You learn something new every decade...
« Reply #6 on: December 17, 2020, 07:45:15 pm »
F YouTube and the Progressive a-holes who ruin it.

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

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: You learn something new every decade...
« Reply #7 on: December 17, 2020, 07:56:31 pm »
yeah im also sick of progressive on youtube
You're not done when it works, you're done when it's right.

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Re: You learn something new every decade...
« Reply #8 on: December 17, 2020, 08:37:52 pm »
F YouTube and the Progressive a-holes who ruin it.

Pete
A f. . . .

https://www.youtube.com/watch?v=0qanF-91aJo
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

FellippeHeitor

  • Guest
Re: You learn something new every decade...
« Reply #9 on: December 17, 2020, 09:10:00 pm »
It is known that on the C++ translated side all SELECT CASE blocks are a bunch of IFs, but this has gone too far.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: You learn something new every decade...
« Reply #10 on: December 17, 2020, 09:14:46 pm »
yeah im also sick of progressive on youtube

Bill, since when did you pick up a sense of humor, and did you purchase or lease?

Pete :D

 - Only NASCAR drivers are safe with Progressive because they only insure left turns.
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

FellippeHeitor

  • Guest
Re: You learn something new every decade...
« Reply #11 on: December 17, 2020, 11:46:24 pm »
Fix to the issue pushed into the repository. Please help test it, @Pete and everyone else: https://www.qb64.org/portal/development-build/

Turns out issue went deeper than IF being allowed - all control block structures were being allowed, like DO/LOOP, WHILE/WEND, FOR/NEXT. All of that has been fixed now.

  [ You are not allowed to view this attachment ]  
« Last Edit: December 17, 2020, 11:51:17 pm by FellippeHeitor »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: You learn something new every decade...
« Reply #12 on: December 18, 2020, 01:17:52 am »
Bad form exists every where, I guess.
Granted after becoming radioactive I only have a half-life!

Offline gaslouk

  • Newbie
  • Posts: 29
    • View Profile
Re: You learn something new every decade...
« Reply #13 on: December 18, 2020, 01:25:34 am »
  [ You are not allowed to view this attachment ]    [ You are not allowed to view this attachment ]    [ You are not allowed to view this attachment ]    [ You are not allowed to view this attachment ]