Author Topic: Question on integer symbol and REM with '  (Read 4764 times)

0 Members and 1 Guest are viewing this topic.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Question on integer symbol and REM with '
« on: May 31, 2018, 12:42:44 am »
Maybe this was addressed in a later update than my 1.1 version from late 2016....

REM Pete's discovered that and apostrophe used in a REM statement changes the color of the text past the apostrophe.

Of course it thinks it's a REM statement, so it colors it blue by default, but in reality, it's just a contraction. We shouldn't worry about contractions, unless they start coming every two minutes. Too soon, Fell?

Oh, and the other thing. Why is something like myvariable%% (Double percent signs) accepted in the IDE?

Inquiring minds want to know... and I wouldn't mind an answer, either.

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

FellippeHeitor

  • Guest
Re: Question on integer symbol and REM with '
« Reply #1 on: May 31, 2018, 01:19:23 am »
Since REM statements ignore comment coloring, the syntax highlighter believes a "colorable" comment began at the apostrophe, just as you suspected. It sounds like a simple IF block away for that to be fixed, low priority of course.

myVariable%% is valid because %% is the type sygil for the _BYTE type. ~%% is for _UNSIGNED _BYTE.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Question on integer symbol and REM with '
« Reply #2 on: May 31, 2018, 02:33:38 am »
Thanks. I have to admit I wouldn't know an _unassigned _byte if it came up an _bit me in the ascii.

And as for the IDE issue...."low priority??? " I expected something more in the neighborhood all out coding Armageddon but then as Steve has stated, I'm a bit of a drama king... OK, Steve might not have used the word "king" but I recall it had some association with royalty, so I'm going with king.

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

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Question on integer symbol and REM with '
« Reply #3 on: May 31, 2018, 09:27:22 am »
Dang I am getting behind in my updates, you've got an _unassigned type now too?

Is that for the royal...?

FellippeHeitor

  • Guest
Re: Question on integer symbol and REM with '
« Reply #4 on: May 31, 2018, 09:28:31 am »

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Question on integer symbol and REM with '
« Reply #5 on: May 31, 2018, 12:00:27 pm »
@bplus
There are total 11 types available in qb64.

Quote
Taken from http://qb64.org/wiki/Keyword_Reference_-_Alphabetical

Variable Name Type Suffixes
$ STRING text character type: 1 byte
! SINGLE floating decimal point numerical type (4 bytes)
# DOUBLE floating decimal point numerical type (8 bytes)
## _FLOAT QB64 decimal point numerical type (32 bytes)
~ _UNSIGNED QB64 whole positive numerical type when it precedes the 6 numerical suffixes below:
% INTEGER whole numerical type (2 bytes)
& LONG whole numerical type (4 bytes}
&& _INTEGER64 QB64 whole numerical type (8 bytes)
` _BIT QB64 whole numerical type (1 bit) (Key below tilde (~) or CHR$(96))
%% _BYTE QB64 whole numerical type (1 byte)
%& _OFFSET QB64 whole numerical pointer address type (any byte size required)
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 bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Question on integer symbol and REM with '
« Reply #6 on: May 31, 2018, 01:23:04 pm »
Hi Ashish,

Seriously, there are way more than 11:
https://www.qb64.org/wiki/Variable_Types

But I wasn't being serious before, I was stalling from the project of testing mod 2 coverage of Battleship with mod 3 coverage. I gave your idea of playing AI against AI a second thought and decided to test these 2 options of doing AI, against each other. Thanks for your input and stay tuned... :)
« Last Edit: May 31, 2018, 01:25:48 pm by bplus »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Question on integer symbol and REM with '
« Reply #7 on: May 31, 2018, 03:07:10 pm »
QB64's OK, but I'll stick with Baskin-Robbins. They have 31 and you can get them in single or double (scoops). Now get busy and make me a vanilla "clone."

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