compiler problems

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
User avatar
yacinator
Full Member
Posts:33
Joined:Sun Dec 21, 2003 12:02 am
compiler problems

Post by yacinator » Fri Jan 23, 2004 12:06 pm

Ok I'm using the firstbas compiler to compile a program to EXE. The problem is that it sais "parameter type mismatch" . I the call statement there is (data$(),num)
in the sub there's the same thing ; string array and a number varible.

Here's the code:

Code: Select all

DECLARE SUB bubble (data$(), num!)
DECLARE SUB sort (data$(), num!)
DECLARE SUB shll (data$(), num!)
DECLARE SUB display (data$(), num!)
DECLARE SUB enterDATA (data$(), num!)
CLS
DIM data$(1 TO 1000)
DO
CALL enterDATA(data$(), num)
CALL sort(data$(), num)
PRINT
CALL display(data$(), num)
PRINT
INPUT "do you want to sort any more data [y/n]: ", yn$
PRINT
LOOP UNTIL yn$ = "n" OR yn$ = "N"
END

SUB bubble (data$(), num)
FOR index = 1 TO num - 1
FOR n = 1 TO num - index
IF data$(n) > data$(n + 1) THEN
SWAP data$(n), data$(n + 1)
END IF
NEXT n
NEXT index
END SUB

SUB display (data$(), num)
FOR i = 1 TO num
PRINT i; "."; data$(i)
NEXT i
END SUB

SUB enterDATA (data$(), num)
LET num = 0
DO
LET num = num + 1
INPUT "enter the data :", data$(num)
INPUT "do you want to enter any more data? [y/n] :", yn$
LOOP UNTIL yn$ = "n" OR yn$ = "N"
END SUB

SUB shll (data$(), num)
LET gap = INT(num / 2)
DO WHILE gap >= 1
DO
LET doneFLAG = 1
FOR index = 1 TO num - gap
IF data$(index) > data$(index + gap) THEN
SWAP data$(index), data$(index + gap)
LET doneFLAG = 0
END IF
NEXT index
LOOP UNTIL doneFLAG = 1
LET gap = INT(gap / 2)
LOOP
END SUB

SUB sort (data$(), num)
IF num < 30 THEN
CALL bubble(data$(), num)
ELSE
CALL shll(data$(), num)
END IF
END SUB

Can you please help me with this. I tried to fix this myself but I just don't know what to do. There's no bug that I can see.

User avatar
yacinator
Full Member
Posts:33
Joined:Sun Dec 21, 2003 12:02 am

Re: compiler problems

Post by yacinator » Sat Jan 24, 2004 4:55 am

Oh yeah it works with QB 1.1 but it doesn't work with the compiler

User avatar
yacinator
Full Member
Posts:33
Joined:Sun Dec 21, 2003 12:02 am

Re: compiler problems

Post by yacinator » Sat Jan 24, 2004 5:12 am

ok i used a diffrent compiler i don't need any more help

Post Reply