I think it's confusing to support deprecated commands. Just remove them and let the coder deal with any error messages. You're just making extra work for yourself for nothing. Don't hold the coder's hand all the time for basic errors like this. IMO.PureBasic Manual wrote:Warning
This function is deprecated, it may be removed in a future version of PureBasic. It should not be used in newly written code.
Deprecated commands
-
MachineCode
- Addict

- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Deprecated commands
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: Deprecated commands
Isn't it new that the deprecated functions are listed in the help file?
I think it's a very good idea to do so because there are often questions from newbies like "what means the CreateGadgetList() warning" etc. - This way it's a lot easier to find the new function name.
I think it's a very good idea to do so because there are often questions from newbies like "what means the CreateGadgetList() warning" etc. - This way it's a lot easier to find the new function name.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: Deprecated commands
I saw them only in the history, some times I looked for them using "Find" in that list.c4s wrote:Isn't it new that the deprecated functions are listed in the help file?
Personally I find the "deprecated" message a good thing. Gives the time to update your program later and still enable you to to use the features of a latest version. You are warned, don't count on this forever and plan to update it, but you are not requested to do it immediately.
"Have you tried turning it off and on again ?"
Re: Deprecated commands
The deprecated commands are not for existing users, but for new ones. If they copy a code with a non-existing function from the forum they won't know what to do if the message is just "function does not exist". Not everybody knows the PB history by heart and knows which functions have been removed and why.
> Isn't it new that the deprecated functions are listed in the help file?
Yes its new. The idea is to give enough information on where to look for a replacement for such a function, but no further information on the deprecated function itself so people are not tempted to keep using it in new code.
> Isn't it new that the deprecated functions are listed in the help file?
Yes its new. The idea is to give enough information on where to look for a replacement for such a function, but no further information on the deprecated function itself so people are not tempted to keep using it in new code.
quidquid Latine dictum sit altum videtur
Re: Deprecated commands
I like the message. If I use one of my older include files and I have not yet done an update I get a warning, so I have some time to take care of matters and no ugly surprises...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
- Michael Vogel
- Addict

- Posts: 2867
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: Deprecated commands
The message is helpful, an additional [Repair] button/popup which converts the given line to the actual syntax would be perfect 
Re: Deprecated commands
Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
In fact, come to think of it, it would also simplify many issues with old code... If the compiler encounters a discarded keyword, throw an error, pop up the requester, and show a hotlink into the help file to the replacement or some related code. If the compiler encounters a deprecated command, still pop up the warning but keep compiling. For all practical purposes, it's little more than a two column list, isn't is?
Effectively, if a user would try to run (copy / paste) some old code, he / she would at least have some clue where to go or what to look for.
In fact, come to think of it, it would also simplify many issues with old code... If the compiler encounters a discarded keyword, throw an error, pop up the requester, and show a hotlink into the help file to the replacement or some related code. If the compiler encounters a deprecated command, still pop up the warning but keep compiling. For all practical purposes, it's little more than a two column list, isn't is?
Effectively, if a user would try to run (copy / paste) some old code, he / she would at least have some clue where to go or what to look for.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: Deprecated commands
E.g. CountList() says: "This function has been replaced by ListSize(). Use that instead." I'd say that's enough.blueznl wrote:Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
Zach
- Addict

- Posts: 1678
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Deprecated commands
c4s wrote:E.g. CountList() says: "This function has been replaced by ListSize(). Use that instead." I'd say that's enough.blueznl wrote:Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
This is what I was thinking too.
-
MachineCode
- Addict

- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: Deprecated commands
True, I didn't consider that aspect of it. Sorry for my suggestion, then!freak wrote:If they copy a code with a non-existing function from the forum they won't know what to do if the message is just "function does not exist"
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: Deprecated commands
Yup. What I was thinking is keep some sort of warning in there, because after deprecated comes discontinued. So if something is no longer supported, it would no longer be flagged as deprecated, but it would just cause a compiler error. And that's not very beginner friendlyc4s wrote:E.g. CountList() says: "This function has been replaced by ListSize(). Use that instead." I'd say that's enough.blueznl wrote:Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
