Author Topic: What _BYTE or _UNSIGNED _BIT happens?  (Read 4145 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
What _BYTE or _UNSIGNED _BIT happens?
« on: July 05, 2021, 01:02:09 pm »
Hi QB64 community
on Discord it has been managed an issue about _UNSIGNED _BIT
at the end the fixing workaround has been to use _BYTE at the place of _BIT because _BIT is virtual.

but now please copy and paste this code into QB64
Code: QB64: [Select]
  1.  
  2.  
  3.  settest1 sb
  4.  
  5. Sub settest1 (b As _Byte)
  6.     If b Then
  7.         Print "true"
  8.     Else                       `
  9.         Print "false"
  10.     End If
  11.  
  12.  
you should get the error as in the QB64 window on the right of the screenshot.
After changing the name to the variable and after saving the code as new file the error disappears!
  [ You are not allowed to view this attachment ]  
What kind of Alien invisible code is hidden in QB64?
Is Galleon coming from Area 52???
Are all us hypnotized by hidden characters of the QB64 IDE?

Waiting your experiences.
Programming isn't difficult, only it's  consuming time and coffee

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #1 on: July 05, 2021, 10:40:58 pm »
Can't find any errors but this line

Else                       `
has one

*****example
DIM B AS _BIT

B has only two possible values 0, -1

******

DIM C AS _UNSIGNED _BIT
C has only two possible values 0, 1
« Last Edit: July 05, 2021, 11:00:02 pm by NOVARSEG »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #2 on: July 05, 2021, 11:30:03 pm »
Did you type that code in the IDE? or copy it from another text editor?
We have, well I have anyway(and shared before), seen that error before on the ELSE of an IF THEN statement when using an external text editor then bringing the code into the IDE.

I do not believe an explanation has ever been found.
Retyping the code in the IDE or editing the code from within the IDE will typically resolve the error.

Last saw this while working on Dragon Warrior editing some of the include files from a text editor. when loading the program it would bug out with this exact error until I opened the include file in the ide and edited the code then save, just as you have.

So who knows? Been around since at least version 1.1 maybe earlier.
Granted after becoming radioactive I only have a half-life!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #3 on: July 05, 2021, 11:43:51 pm »
Did you type that code in the IDE? or copy it from another text editor?
We have, well I have anyway(and shared before), seen that error before on the ELSE of an IF THEN statement when using an external text editor then bringing the code into the IDE.

I do not believe an explanation has ever been found.
Retyping the code in the IDE or editing the code from within the IDE will typically resolve the error.

Last saw this while working on Dragon Warrior editing some of the include files from a text editor. when loading the program it would bug out with this exact error until I opened the include file in the ide and edited the code then save, just as you have.

So who knows? Been around since at least version 1.1 maybe earlier.

Might be one of those invisible spaces such as a CHR$(0) or CHR$(255) at work.  Or a hardcoded tab?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #4 on: July 06, 2021, 12:40:43 am »
Else                       `

there is a ` at the end of the above line it looks like a '

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #5 on: July 06, 2021, 09:20:44 am »
How does QB64 treat the backwards tick?

In some languages, it is used in place of a single quote, such as when a program is creating HTML that has ' and " that are needed.

From a scripting language (COBOLScript) that does not use escape characters:
Quote
DISPLAY `<FORM ACTION="/cgi-bin/cobolscript.exe?webban.cbl" METHOD="POST">`.
DISPLAY `Banner Text:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE="TEXT"  SIZE="8" NAME="banner_contents" VALUE="">`.

The reason escape characters are not used is they can appear in the HTML and must not be translated.

So if I were to use a QB64 program to create a webpage, can I use the backwards tick? If not, would this be a worthwhile enhancement to QB64?


Else                       `

there is a ` at the end of the above line it looks like a '
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #6 on: July 06, 2021, 09:22:10 am »
@George McGinn The backtick is used for the _BIT type suffix.
Shuwatch!

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • View Profile
    • Resume
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #7 on: July 06, 2021, 09:32:52 am »
@SpriggsySpriggs Is that the same _BIT type that does not work as expected (because it is to provide compatibility with QBasic?)

@George McGinn The backtick is used for the _BIT type suffix.
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #8 on: July 06, 2021, 09:33:59 am »
@George McGinn QBASIC does not have a definition for _BIT. _BIT is a QB64 type.
Shuwatch!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: What _BYTE or _UNSIGNED _BIT happens?
« Reply #9 on: July 06, 2021, 09:53:41 am »
Hi boys and girls of QB64Land

I thank you very much to give me feedbacks.

I have copy and past the code from Discord to store an example that was mysterious. But the original coder have a different issue that ha has solved following the suggestion to change the type of data .

I have thought that it was a strange character invisible (not showed by QB64IDE) but visible to the parser just to activate a warning /message of error.
In fact saving the code from into QB64IDE and loaded as new file the glitch disappears instead saving the same file also after typing a  space char to activate the Saving routine, it lasted there.

Programming isn't difficult, only it's  consuming time and coffee