Board Logo
« [BB] Deprecated and obsolete syntax »

Welcome Guest. Please Login or Register.
Nov 20th, 2017, 10:24pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: [BB] Deprecated and obsolete syntax  (Read 240 times)
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
xx [BB] Deprecated and obsolete syntax
« Thread started on: Aug 29th, 2010, 08:17am »

Due to the overload of the PRINT command, we could flag the PRINT with comma to be deprecated or obsolete.

Example graphics box PRINT method:

Current Quote:
Graphics Window

1. PRINT #WindowHandle, "print"
2. PRINT #WindowHandle, "print vga"
3. PRINT #WindowHandle, "print svga"
4. PRINT #WindowHandle, "print xga"
5. #WindowHandle "print"
6. #WindowHandle "print vga"
7. #WindowHandle "print svga"
8. #WindowHandle "print xga"


Reworked Quote:
Graphics Window

1. #WindowHandle "print"
2. #WindowHandle "print vga"
3. #WindowHandle "print svga"
4. #WindowHandle "print xga"

Deprecated/Obsolete
5. Print #WindowHandle, "print ..."


What do you think?
« Last Edit: Aug 29th, 2010, 08:19am by Stefan Pendl » User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
jaba
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 1049
xx Re: [BB] Deprecated and obsolete syntax
« Reply #1 on: Aug 29th, 2010, 09:53am »

My thoughts; I still find myself often using the "long form", sometimes interchangeably.

Since we are describing the use of "Print" commands, might be best to keep the word and comma in, at anyone's option, of course.

But, I am in favor of telling the user the status of this form of use. I'd be in favor of a statement in the description, right off the bat, where the reader will be made aware of it. Something like:

Print has two forms of use that are acceptable.
1. PRINT #handle, "print" (the LONG form)
2. #handle "print" (the SHORT form)
The use of the SHORT form is encouraged as being more up-to-date.

User IP Logged

JACK - Windows 8.1 64-bit; 2.5 GHz Intel i3 processor; 6.00 GB RAM;
TyCamden
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 1431
xx Re: [BB] Deprecated and obsolete syntax
« Reply #2 on: Aug 29th, 2010, 10:34am »

Maybe I am alone on this one, but why is print in quotation marks?

If the word in quotation marks just happens to be print, perhaps change it to "text here" to limit confusion.
User IP Logged

TyCamden

Please give credit if you use code I post, no need to ask for permission.


Just BASIC 1.01, Windows 7 Home Premium version (2009), AMD Athelon II 320 Dual-Core Processor 2.10 GHz - 4.00 GB RAM (3.75 usable) - 64-bit OS
jaba
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 1049
xx Re: [BB] Deprecated and obsolete syntax
« Reply #3 on: Aug 29th, 2010, 10:39am »

on Aug 29th, 2010, 09:53am, jaba wrote:
Since we are describing the use of "Print" commands, might be best to keep the word and comma in, at anyone's option, of course.


There I go again. Getting confused by using the word "print". Just ignore that last post, please... undecided
User IP Logged

JACK - Windows 8.1 64-bit; 2.5 GHz Intel i3 processor; 6.00 GB RAM;
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
xx Re: [BB] Deprecated and obsolete syntax
« Reply #4 on: Aug 29th, 2010, 10:59am »

on Aug 29th, 2010, 10:34am, TyCamden wrote:
Maybe I am alone on this one, but why is print in quotation marks?

Because this is the method to send the last flushed segment to the printer.

Do not confuse it with the print command, which is used to send the command string including the GUI method to the GUI control or window.



The top confusion is using print to send output to the main window (some call it console window, but it does not have the capabilities of a true DOS console window), send output to files opened for output/append and to send command strings to GUI controls and windows.

This overload of the PRINT command adds to the confusion.



And remember that the INPUT command can be used in special ways in the GUI world too, so one additional command, which is not simple.

Use it in an input loop instead of wait to get a value assigned to a button instead of an event handler or to get the contents of a control.



All this backward compatibility issues are making things harder to understand.
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
uncleBen
Senior Member
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1679
xx Re: [BB] Deprecated and obsolete syntax
« Reply #5 on: Aug 29th, 2010, 11:04am »

Could you post a link to where it says that using PRINT with GUI widgets is deprecated/obsolete? We should rewrite FreeForm's code generation routines immediately...

And, what are the plans for the old syntax in LB5?

http://en.wikipedia.org/wiki/Deprecation
User IP Logged

Passing arrays to subroutines, functions that work with any types, quick string indexing and much more - JBExtensions.

Tired of Minesweeper? Try TomatoSweeper
jaba
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 1049
xx Re: [BB] Deprecated and obsolete syntax
« Reply #6 on: Aug 29th, 2010, 11:08am »

@ Stefan; In Ty's defense, I think he is probably refering to my STUPID use of the quoted "print" in my reply. But, your explanation helps even more.

Sorry for the confusion.
Jack
User IP Logged

JACK - Windows 8.1 64-bit; 2.5 GHz Intel i3 processor; 6.00 GB RAM;
TyCamden
Global Moderator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 1431
xx Re: [BB] Deprecated and obsolete syntax
« Reply #7 on: Aug 29th, 2010, 11:33am »

on Aug 29th, 2010, 11:08am, jaba wrote:
@ Stefan; In Ty's defense, I think he is probably refering to my STUPID use of the quoted "print" in my reply. But, your explanation helps even more. Sorry for the confusion.


Not stupid, just confusing.

Perhaps replace the word print within the quotes with "text here" or something - to help people trying to understand the command better.
User IP Logged

TyCamden

Please give credit if you use code I post, no need to ask for permission.


Just BASIC 1.01, Windows 7 Home Premium version (2009), AMD Athelon II 320 Dual-Core Processor 2.10 GHz - 4.00 GB RAM (3.75 usable) - 64-bit OS
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
xx Re: [BB] Deprecated and obsolete syntax
« Reply #8 on: Aug 29th, 2010, 12:46pm »

on Aug 29th, 2010, 11:04am, uncleBen wrote:
Could you post a link to where it says that using PRINT with GUI widgets is deprecated/obsolete?

There is nothing I can link to, but having only one clean syntax format would help people learning the language.
Omitting PRINT and the comma for any interaction with a handle, would better separate these from regular output to the main window.

Quote:
We should rewrite FreeForm's code generation routines immediately...

You are welcome to do so, since it is open source.
There are already some updated versions at the files archive.

Quote:
And, what are the plans for the old syntax in LB5?

As you can see with RB the old syntax to use command strings will still be supported, but using functions for the methods has been implemented.



For instance:

#Handle "CLS" ... #Handle CLS() ... #Handle CLS("white")

are all the same for RB/LB5, where the last format implies a fill too.
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Stefan Pendl
Administrator
ImageImageImageImageImage


member is offline

Avatar

Let's talk JB ...


Homepage PM

Gender: Male
Posts: 3711
xx Re: [BB] Deprecated and obsolete syntax
« Reply #9 on: Aug 29th, 2010, 12:48pm »

on Aug 29th, 2010, 11:33am, TyCamden wrote:
Perhaps replace the word print within the quotes with "text here" or something - to help people trying to understand the command better.

I just copied this from a keyword, where I knew some formats are available.
User IP Logged

Stefan - Homepage

Remember to read the forum rules board wink

Just BASIC 1.01, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
tsh73
JB-Supporter


member is offline

Avatar




PM

Gender: Male
Posts: 3614
xx Re: [BB] Deprecated and obsolete syntax
« Reply #10 on: Aug 30th, 2010, 02:20am »

Quote:
We should rewrite FreeForm's code generation routines immediately...

Aren't they say
Quote:
if it ain't broke, don't fix it
?

As a side note. probably Tips section needs stikied and locked post, pointing where most current version of FreeForm is.
Or most new users will stick with old, default FreeForm, installed with JB.
User IP Logged

Q: "And if I took your codes and compile them, and sell them for a profit"?
A: Go ahead. I had my share of good then I coded it for fun, if you can make better use of it - please do.
(enjoying JB 1.01 on WinXP, netbook and desktop)
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls