Author Topic: First time use of qb64, converting an old program from msoft qbx - syntax error,  (Read 2808 times)

0 Members and 1 Guest are viewing this topic.

Offline JackLRJohnson

  • Newbie
  • Posts: 2
    • View Profile
First time using qb64, Win 7, I have a statement:
REM $INCLUDE: 'D:\REGRESS\SCRNCOMM.BI' early in my program (line 33)

the line has a red background,
the error message is:
"Invalid variable name in line 2 of D:\REGRESS\SCRNCOMM.BI included on line 33 (click here or Ctrl+Shift+G to jump there)

if I "click here" it does not open the SCRNCOMM.BI file.  Instead, it changes the last part of the error message to "included on current line"

What am I missing?
Thanks,
Jack

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Hi. That's weird. Do you have a BI file in the QB64 installation folder? What contain row 2 in the BI file?
What it do, if you try '$include:'yourfile.bi' ?

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Really. If i use full path with drive name, it then open not bi file! So, try bi file copy to installation folder, or, if is it possible use path with ../regress/scrncomm.bi

FellippeHeitor

  • Guest
Try double-clicking the line with the error.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Fellippe, no option if is used full path:


Offline MWheatley

  • Newbie
  • Posts: 64
    • View Profile
Why is it even looking at it?  The line in question begins with "REM".

Malcolm

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
REM and character  '  is the same for precompiler, $INCLUDE is a meta command, no matter if before INCLUDE is REM, or  ' , the precompiler reads it though there is REM. It's basically an extension of the program from another file. The new IDE knows it and can open its own copy with this file. But not in this case with full path...

it is maybe bug, because if is path writed with .., then is there option for opening BI file (my installation folder is on the same drive but on other directory):



« Last Edit: May 24, 2019, 04:46:48 pm by Petr »

Offline JackLRJohnson

  • Newbie
  • Posts: 2
    • View Profile
I don't know how to use this forum.  When I tried to attach a screen shot, Firefox jumped to a new tab, displayed the screen pic, but I have no clue as to how to get my reply back on the screen.  It vanishes.  Each time I come back to the forum, my previous message is gone.  I don't know what to do.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Hi JackLRJohnson

1. about your issue

A) download the file This.bi attached at this answer and put it in QB64 folder

B)CPR this code
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. rem $include:'this.BI'
  3. CIRCLE (100, 200), 300, _RGBA(127, 222, 11, 255)
  4. PAINT STEP(0, 0), _RGBA(127, 222, 11, 255), _RGBA(127, 222, 11, 255)

can you duplicate your experience?

see screenshot
  [ You are not allowed to view this attachment ]  
  [ You are not allowed to view this attachment ]  

Well in screenshot there are instructions about how to use QB64 Ide to manage included files into your code.

Be sure that the path of include file is right!  Following your words it is so because the feedback of IDE is an error in include file and not File not found. So you have two way to solve your issue
  1. rem the rem line with $include: again, in this manner you cut out the included file, if it doesn't matter
Quote
REM REM $INCLUDE:'this.BI'
or
'REM $INCLUDE:'this.BI'
  2. open the included file and work in it to see what kind of problem there is ... (often it is a duplicate of name of something like variables, costants, label, functions, subs) In your case it seems about the rules to do a name in QB64 see here info http://qb64.org/wiki/Variable

PS about posting... it is just since a time that I don't use more Mozilla but it worked well....
I can sure you that both Chrome, both Edge, both Explorer and Opera work fine.
Programming isn't difficult, only it's  consuming time and coffee