compile problem

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

compile problem

Post by Seb McClouth »

I'm using a .mak to load in PDS. That goes all well.

I have several things DIM SHARED or CONST, but alls those things aren't passed on somehow.
Every file which I have loaded through .mak contains the '$include-thingy, but when running the code everything which has to be loaded into the DIM SHARED or CONST is not there anymore.

This while running in PDS and even after having compile the whole thing.

Grtz
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

Try Common Shared for BAS files. That works with CHAINed modules.
SHARED values are only shared inside of that module. Otherwise try using a data file that the programs can just pass the values in. Stand alone EXE files require data files, as Common Shared does not work without BRUN.EXE. Although I have never messed with PDS.

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

Ok I'll give that a try. I do have to say that I have a .bi-file containing the DECLARE's, DIM SHARED's, CONST's, and $INCLUDEd it in all the modules.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

Ted, I've tried the changing DIM to COMMON and it works!! Thx mate!!
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

Alright now I'm trying to compile a lib and I get stuck at the following:

Code: Select all

FUNCTION CheckID! (ChID AS LONG)
DO
  FOR a = 1 TO 15
     IF PID.appshelf(a) = ChID THEN
       ChID = GenID!(5)
     ELSE
       check = 1
     END IF
  NEXT
LOOP UNTIL check = 1
END FUNCTION

FUNCTION GenID! (Lenght AS INTEGER)
RANDOMIZE TIMER
FOR a = 1 TO Lenght
  s$ = s$ + LTRIM$(RTRIM$(STR$(INT(9 * RND))))
NEXT
GenID! = VAL(s$)
END FUNCTION
When I try to do a library compile I get the following:
[C:\WINNT\system32\cmd.exe - qbx qbinux /l] wrote: temp! = CheckID!(GenID!(5))
^ Parameter type mismatch
Anyone got a clue what might the causing the problem? and how to solve this?

Grtz
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

ChID is defined as LONG and cannot equal a value from a single type array.

& <> !

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

Okay, basically I have the ! & mixed up, right?
So that means that I should have this code:

Code: Select all

FUNCTION CheckID& (ChID AS LONG) 
DO 
  FOR a = 1 TO 15 
     IF PID.appshelf(a) = ChID THEN 
       ChID = GenID&(5) 
     ELSE 
       check = 1 
     END IF 
  NEXT 
LOOP UNTIL check = 1 
END FUNCTION 

FUNCTION GenID& (Lenght AS INTEGER) 
RANDOMIZE TIMER 
FOR a = 1 TO Lenght 
  s$ = s$ + LTRIM$(RTRIM$(STR$(INT(9 * RND)))) 
NEXT 
GenID& = VAL(s$) 
END FUNCTION 
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

[quote="Seb McClouth"]Okay, basically I have the ! & mixed up, right?
So that means that I should have this code:

Code: Select all

FUNCTION CheckID& (ChID AS LONG) 
DO 
  FOR a = 1 TO 15 
     IF PID.appshelf(a) = ChID THEN 
       ChID = GenID&(5) 
     ELSE 
       check = 1 
     END IF 
  NEXT 
LOOP UNTIL check = 1 
END FUNCTION 

FUNCTION GenID& (Lenght AS INTEGER) 
RANDOMIZE TIMER 
FOR a = 1 TO Lenght 
  s$ = s$ + LTRIM$(RTRIM$(STR$(INT(9 * RND)))) 
NEXT 
GenID& = VAL(s$) 
END FUNCTION 
Thx for this insight.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

Okay, it works. But now I'm stuck with a 'COMMON in Quick library too small'. I think I know what's causing this, but how to solve it? Does any one know.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

I've fixed this by replacing some with DIM SHARED again. Only gotten a new problem. When I try to recompile the library, which used the same .bi-file... it gives error about all the COMMON SHARED... Any ideas on how to fix this?
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
Post Reply