QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: TempodiBasic on July 05, 2021, 01:02:09 pm

Title: What _BYTE or _UNSIGNED _BIT happens?
Post by: TempodiBasic 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!
  [ This attachment cannot be displayed inline in 'Print Page' view ]  
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.
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: NOVARSEG 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
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: Cobalt 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.
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: SMcNeill 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?
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: NOVARSEG on July 06, 2021, 12:40:43 am
Else                       `

there is a ` at the end of the above line it looks like a '
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: George McGinn 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 '
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: SpriggsySpriggs on July 06, 2021, 09:22:10 am
@George McGinn The backtick is used for the _BIT type suffix.
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: George McGinn 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.
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: SpriggsySpriggs on July 06, 2021, 09:33:59 am
@George McGinn QBASIC does not have a definition for _BIT. _BIT is a QB64 type.
Title: Re: What _BYTE or _UNSIGNED _BIT happens?
Post by: TempodiBasic 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.