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 Problem

Author
Message
Black Hydra II
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 5th Dec 2003 05:03
I'm sorry if I sound like just another coder who forgot to do something simple and immediatly ran to these boards. I have been coding for some time now and have successfully made games involving functions and I do know exactly what they are ect...

My problem is I am making a simple GUI header file so that I can load it into programs. One of the simpler functions is to make a label. (P.S I know it doesn't work despite the error. I tried it on its own to see if that was the problem...). When I compile it, it spits out a message saying that it could not find structure ___ the reason I leave blanks is because the message changes if I modify the code even slightly.

I am not very proficient with 2-D. I have mostly been practicing 3-D
commands. So that could be the problem. I also had no idea how to set the function parameter color to a DWORD. Perhaps thats where I screwed up. Either way could one of you expert take a glance at my very tiny program and tell me what I might have done wrong?

`Label Test Code
INPUT "Hello, what would you like the label to say?", Message$
Label(100, 50, 200, 150, RGB(250, 250, 250), Message$)
Wait Key



FUNCTION Label(Width#, Height#, X#, Y#, Color AS DWORD, Message$)
INK Color, 0
Left# = Width#-(X#/2)
Right# = Width#+(X#/2)
Top# = Height#-(X#/2)
Bottom# = Height#+(X#/2)
Box Left#, Top#, Right#, Bottom#
Center Text X#, Y#, Message$
ENDFUNCTION

Thanks in advance.

"Damn had to remake account!" direct quotation from previous account.
Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 5th Dec 2003 05:51
It would appear the compiler does not like the word Label for a function name. With a slight change it compiles:



Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Black Hydra II
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 6th Dec 2003 00:30
Hmmmm... That is very odd. I'll remember that in the future.

"Damn had to remake account!" direct quotation from previous account.

Login to post a reply

Server time is: 2024-11-25 19:20:54
Your offset time is: 2024-11-25 19:20:54