Author Topic: Not seeing loaded source file  (Read 2959 times)

Offline AlienMenace

  • Mr. Polyvector
  • ***
  • Posts: 149
    • View Profile
Not seeing loaded source file
« on: 2011-Mar-01 »
Not sure why this happening but sometimes when I add a source file with functions, the main programs claims not to be able to see them and throws a ( 8 ) error : call to undefined function : error. The same exact include file in another project works just fine.
Apps published: 3

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Not seeing loaded source file
« Reply #1 on: 2011-Mar-01 »
yre you sure you have that file in the files tab?

Offline AlienMenace

  • Mr. Polyvector
  • ***
  • Posts: 149
    • View Profile
Re: Not seeing loaded source file
« Reply #2 on: 2011-Mar-01 »
Yes, it's there as a tab. I checked the project file as well in wordpad and it shows the file listed there as a source file as well. I've also had situations where a source file's functions worked fine in one program but failed when called the exact same way in another program.
Apps published: 3

MrTAToad

  • Guest
Re: Not seeing loaded source file
« Reply #3 on: 2011-Mar-01 »
Could you make the project and files available ? I suspect its due to the order that the files are compiled...

Offline AlienMenace

  • Mr. Polyvector
  • ***
  • Posts: 149
    • View Profile
Re: Not seeing loaded source file
« Reply #4 on: 2011-Mar-16 »
It happens every time I try to add a new source file, then copy code into the new tab then save all. It does not see the new source file even though it is listed in the tabs and the code is there when you click on it. It happens every time I try to do this. I even check the project file and both the main and the added source file are there but glbasic complains that the functions does not exist.
Apps published: 3

Offline backslider

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 892
    • View Profile
Re: Not seeing loaded source file
« Reply #5 on: 2011-Mar-16 »
Is the function highlighted when you use it in another file?

Offline AlienMenace

  • Mr. Polyvector
  • ***
  • Posts: 149
    • View Profile
Re: Not seeing loaded source file
« Reply #6 on: 2011-Mar-16 »
Yes, but even when it is highlighted, it is still a problem.

When I load this project, the sayhello() function call in the  Test.gbas tab of the editor is white, if I then click on the Hello.gbas tab then click anywhere in the pane then click back to Test.gbas, the sayhello() function call turns purple. It makes no difference though, it still errors out.

« Last Edit: 2011-Mar-16 by AlienMenace »
Apps published: 3

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Not seeing loaded source file
« Reply #7 on: 2011-Mar-16 »
are you switching to the "variables" view in the side bar?

MrTAToad

  • Guest
Re: Not seeing loaded source file
« Reply #8 on: 2011-Mar-16 »
Is the file included in the project ?

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2702
    • View Profile
Re: Not seeing loaded source file
« Reply #9 on: 2011-Mar-16 »
Is the file included in the project ?


My thoughts exactly.
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Slydog

  • Prof. Inline
  • *****
  • Posts: 932
  • KodeSource
    • View Profile
    • KodeSource
Re: Not seeing loaded source file
« Reply #10 on: 2011-Mar-16 »
I suspect its due to the order that the files are compiled...

Me too.
Edit the 'Test.gbap' file in Notepad.  (or whatever your project '.gbap' file is called)
You should see the following near the end of the file:

Code: (glbasic) [Select]
   <SRCFILES >
      <FILE PATH=".\Test.gbas" />
      <FILE PATH=".\Hello.gbas" />
   </SRCFILES>

Try reversing the two lines starting with <FILE PATH.....> and save it, then reload the project and try that.
ie. change it to this:
Code: (glbasic) [Select]
   <SRCFILES >
      <FILE PATH=".\Hello.gbas" />
      <FILE PATH=".\Test.gbas" />
   </SRCFILES>

The order may matter in your case, as I need to do this quite often by putting the source file with a function above any other files that call that function.  (Or it may be just TYPES or GLOBALS that require this, not sure)

BUT, if you don't see both files between the <SRCFILES> tags, then your problem is what the others are saying.   You need to add the 'Hello.gbas' file manually to your project (ie: right-click in the 'Files' area on the right and select 'Add File'.)  Because you can edit the file doesn't mean the file is part of the project perhaps.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10762
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Not seeing loaded source file
« Reply #11 on: 2011-Mar-16 »
if you right click a file in the files-pane, you can select "Make Main Program" - That does the swap.

Offline AlienMenace

  • Mr. Polyvector
  • ***
  • Posts: 149
    • View Profile
Re: Not seeing loaded source file
« Reply #12 on: 2011-Mar-21 »
I added it in the file paned and it works now but when I viewed the project file in notepad it was listed there before that. Weird. I thought that if you add it from the file menu that would have been enough. Seems to me to be a little counterintuitive to have to add it to the project again.

Thank you.
Apps published: 3