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.

DarkBASIC Professional Discussion / How to tell the compiler which command to use?

Author
Message
JohnBarbarossa
15
Years of Service
User Offline
Joined: 9th Jul 2009
Location:
Posted: 25th Jul 2009 14:37
I am using IanM's Matrix plugin which I think is great.

However the plugin replaces some of the original commands with the exact same name. The reason is probably that he thinks the new command are better and you never need to use the old one's.

It is possible to tell the compiler to use the native command instead? For example the alpha channel ability of the new rgb() command gets in the way a lot so I want to use the original command.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jul 2009 14:41
No, it doesn't replace - it adds alternatives. The originals are still there and are available, simply by NOT using the extra parameters.

For example MID$(s$, n) will use the DBPro MID$, while MID$(s$, n, l) will use mine.

For your RGB function, simply use 3 parameters and it uses DBPro's function.

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 25th Jul 2009 14:41 Edited at: 25th Jul 2009 14:42
Quote: "For example the alpha channel ability of the new rgb() command gets in the way a lot so I want to use the original command. "


Unless I'm mistaken that would be just an overloaded command allowing you to pass an optional alpha value? In which case you can use both.

Beaten by a few seconds!

JohnBarbarossa
15
Years of Service
User Offline
Joined: 9th Jul 2009
Location:
Posted: 25th Jul 2009 15:10
Thanks for the quick reply's. I didn't realize the new rgb() command needed 4 arguments. Very clear to me now.

However there are still some things not working like they should. I like to put colors in GLOBALS, so that the source is more readable and I can later change the basic colors quickly if needed.
I now also added the fourth alpha channel argument.

This doesn't work (it also doesn't work if I use the 3 parameter RGB command):


This does work (but defeats the purpose of using variables):


The variabele technique does work for other color commands.


I also have problems doing things like this:


So I have to use this instead:
Dar13
17
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 25th Jul 2009 18:00
Perhaps declare border as a DWORD?
Like:


JohnBarbarossa
15
Years of Service
User Offline
Joined: 9th Jul 2009
Location:
Posted: 25th Jul 2009 18:44
I tried it but there was no diffence. Using the border variable instead of the rgb command still results in the wrong color.

Although I it is probably a good idea to define border to DWORD anyway.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Jul 2009 18:53
It works just fine for me:


Using DWORD also makes no difference (as I'd expect)

JohnBarbarossa
15
Years of Service
User Offline
Joined: 9th Jul 2009
Location:
Posted: 25th Jul 2009 21:52
I have it working too now. Somehow the variables got changed accidently along the way.
But thanks for the explanation of the matrix rbg command. That was also needed to get everything working.
Back to coding

Login to post a reply

Server time is: 2025-06-06 09:47:52
Your offset time is: 2025-06-06 09:47:52