Page 1 of 1

compile problem

Posted: Tue Feb 12, 2008 3:30 pm
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

Posted: Thu Feb 14, 2008 1:09 am
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

Posted: Thu Feb 14, 2008 6:18 am
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.

Posted: Thu Feb 14, 2008 1:34 pm
by Seb McClouth
Ted, I've tried the changing DIM to COMMON and it works!! Thx mate!!

Posted: Sat Feb 16, 2008 5:33 pm
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

Posted: Sat Feb 16, 2008 10:40 pm
by burger2227
ChID is defined as LONG and cannot equal a value from a single type array.

& <> !

Ted

Posted: Sun Feb 17, 2008 1:25 am
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 

Posted: Sun Feb 17, 2008 1:25 am
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.

Posted: Sun Feb 17, 2008 1:51 am
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.

Posted: Thu Feb 21, 2008 9:21 am
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?