• Welcome to Jose's Read Only Forum 2023.
 

Wishlist for a new PB Version?

Started by Theo Gottwald, January 23, 2012, 08:21:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Peter Weis

#15
Hello Paul,
Es stands in addition, who it is to only transfer the value to parameter list whom it in the call does not stand! Dan makes it already a sense!

sample:

sub testx(opt a byval x as long = 10)

end sub

call testx()

call testx(0)



The compiler can differentiate that with to compile.

Perhaps did it now understand?

Greet Peter

Paul Elliott

Peter,

I'm not sure I understand. But it seems that you are asking the compiler to do all the checking
that the programmer would have to do to figure out if an optional parameter is there or not.
And if not then to supply the requested default value.

If that is the case then you will never be able to over-ride any passed parameter. No more using
Byval or Byref on the Call statement. The compiler can not see every call at compile time. What if
the call happens between a main program and a dll?

It's much simpler if the programmer takes care of it all.

But if you want to ask for that then go ahead. As long as it is an option that can be turned OFF
so that the programmer can decide what to do.


José Roca

Paul,

Is much simpler than that.

For example:


SUB MySub (BYVAL x AS LONG, OPTIONAL BYVAL y AS LONG = 10, s AS STRING = "My string")


If you call it as MySub(x), it will be equivalent to calling it as MySub(x, 10, "My string")

It's useful for omiting default values when they are different to 0 or "". Many third party libraries written in C++, and also methods of COM servers, use it and in our translations to PB we have to made them not optional or write wrappers.

Theo Gottwald

Quote from: Edwin Knoppert on January 24, 2012, 02:27:24 PM
Local scope would nr #1 for me like:
Function Hello()

dim a as long

a = 100
{
    dim a as int
    a = 123
}

? a (=100)

--

Direct assignment of vars (as above mentioned)
dim a as long = 100

--

Removal of the naming conflicts, conflicts which seem to occure by hidden (PB) macro's or so..
Swap DDT for real SDK windows.


"Local scope " - a Sub inside a Sub?
As the concept is new to me, i have not really an idea what its good for, but i beliefe that this would be easy to do and sounds intresting.

Direct assignment of vars (as above mentioned)

Yes i think thats a good idea. If i remember it right, first steps into this direction have already been done with PB 10.
I think we can already assing some things ... just forgot which.

Removal of the naming conflicts, conflicts which seem to occure by hidden (PB) macro's or so..

Do you have an working example for that?

Swap DDT for real SDK windows.

If so i would prefer Jose's CWindows because its UNICODE and dpi-aware and has anything that a modern up-to-date concept needs.
And add Firefly 3.5 to the package :-). Oh no this will never happen ....  ;D

Peter Weis

#19
Hello Theo,
peek there once. Perhaps it helps you!

SCOPE FreeBasic

http://www.freebasic-portal.de/befehlsreferenz/scope-362.html

greetings Peter

Paul Elliott

I think I'll stick with doing my own default assigns for optional parameters.
That way it is very clear exactly what is being done in every instance.

I don't really feel a need to force PB to be like some other language.
I easily move between several languages and am able to use the standards
of each.



Edwin Knoppert

Local scope is used in c languages

if(a==1)
{

}

Everything inside the {} is a scope.
In PB it could be very helpful with com objects, instead of releasing them manually (if needed for your function) you can let those out of *local* scope.
Imagne a common problem, instantiating a com interface in PBMain and then show a modal form.
The com interface may have not being needed at that point but is still alive.
Local scope could help/teach the programmer to program differently.

In .net there is using() which i also think works nice.
using(Interface1 x =  New Interface1())
{

}

Same stuff (besides the using invokes the dispose() method but that's extra.
I am talking about behaviour as well here.

>Removal of the naming conflicts
No but PB has nowadays much more internal keywords which conflict if you try to use the same one.
To me it lacks the relevance to have those (often obvious) keywords, the compiler should not care for me using keywords not being part of the PB BASIC language or winapi declares.
I heard these may be macro's, i don't care, get rid of those, i don't conflict with the language, the language conflicts with me!

Peter Weis

#22
Hello,

the next that I gladly would like are pre-defined types

sample

type test
    a as long = 5
    b as string * 5 = "Test"
    c as dword
    e as long
end type



greetings Peter

Theo Gottwald

While PB 10 has it all (except x64, and maybe the ability to write Kernel drivers), you can do nearly anything with it.
Yet there is always something to improve. And think about a new version.
However, from my experiences in the past i assume that it wont be before 2015 when we get it :-(.
We will not pay it in EURO that time, maybe we'll pay it in GOLDMARK then.

José Roca

Angela has already destroyed the EU. She has spent years rejecting all kind of decisions only to accept them when it was already too late. All that remains in common in the eurozone is the euro, and only because we are all trapped in it.

Theo Gottwald

Jose,
Angela is not the reason of what you are facing. Long years before the plans for the end of the EURO (is in MID 2014) have already been made.
Most of those who knew the exact date have dissapeared.  ;D
Whatever Angela can do is far beyond what would have been necessary to save the EURO.
She can move around but the strikes on the euro come from over the atlantic.
One of these strikes was that they moved Greece into the euro, which was a false decision at any time.
It was only possible with the false certificates from G+S.
Next they prevent Greece from getting Oil from Iran (for credit), which strengthens the problems there.
Angela has a small country with people paying taxes up to 75%. What can she really do?
She has sold out already anything thats there.
And if she would have got the German GOLD (which is German only on the paper, and is in fact in USA for long time), she would have sold that also.

PS: Today good reaction times here.