Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / function trouble

Author
Message
NCG7479
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location:
Posted: 18th Apr 2004 22:30
someone tell me why this won't work. it always says PARAMETER MISMATCH, END EXPECT NO PARAMETERS
AciDucK
21
Years of Service
User Offline
Joined: 13th Aug 2003
Location:
Posted: 18th Apr 2004 22:34
endfunction is one word, not two. You wrote "end", and "function"
as a parameter.
NCG7479
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location:
Posted: 18th Apr 2004 23:04
I tried it and now it says program ran into a function declaration
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 18th Apr 2004 23:12
Load Bitmap doesn't need parantheses.

Try taking them out - make it :

load bitmap "grass.bmp",1

That could be the problem if you've sorted the endfunction problem out.

NCG7479
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location:
Posted: 18th Apr 2004 23:16
it didn't change anything it still comes up with an error
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 18th Apr 2004 23:22
I could get it to compile in DBPro without any error messages - what version of Dark Basic are you running?

NCG7479
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location:
Posted: 18th Apr 2004 23:25
this is just a the trial version of basic. I hope thats not the problem
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Apr 2004 00:23
post the whole code. It sounds like your executing code is running into a function declaration. Is your program in a loop? Is your function within your main loop? The functions should be at the end of your code outside any main loop or separated from the rest of the program by and END statement.


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
NCG7479
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location:
Posted: 19th Apr 2004 00:35
that basically is my whole code.there is no loop yet because i'm just experimenting right now. But i do know that it has to be used in the main loop.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Apr 2004 01:20 Edited at: 19th Apr 2004 01:20
oh, ok, well then you can't execute that code as is because it is just a function. write some code that calls it and does something with the result if you want to test it.

maybe:




Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
NCG7479
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location:
Posted: 19th Apr 2004 01:31
your code work thanks
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Apr 2004 04:12
no problem. good luck


Home of the VB.NET Class Builder Utility - Demo and FULL versions now available!!
Pheonixx
20
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Columbus, Ohio
Posted: 19th Apr 2004 10:37 Edited at: 19th Apr 2004 10:37
Quote: "function scene()

load bitmap ("grass.bmp"),1
get image 1,0,0,256,256

make matrix 1,1000,1000,11,11
prepare matrix texture 1,1,2,2

end function"


This is a very common mistake. END FUNCTION and ENDFUNCTION are completely different.

Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 19th Apr 2004 11:51
I think we'd got past that stage quite early on - I thought he was receiving a compiler error message I hadn't realised the problem had moved onto it not actually doing anything!!

Login to post a reply

Server time is: 2024-09-22 06:36:12
Your offset time is: 2024-09-22 06:36:12