I LOVE PureBasic!!! - but HATES that a Procedure in Pure can return a value.
A Function returns a value, a Procedure NOT!!
But, I'll guess I have to live with it - even if it makes me sick...
Cheers!



My guess is that he was simply too lazy to add 2 different things for procedures/functionslegider_pb wrote:In PureBasic "Procedures" are Functions, that is just what Fred and whatever other factors decided upon. Maybe he was drunk or high or not it doesn't matter to me cause I like it, it works. PureBasic is one hell of a language.
What are the diffrents between a function and a procedure?techjunkie wrote:I LOVE PureBasic!!! - but HATES that a Procedure in Pure can return a value.

That's true - but as a "Computer Scientist" person I must say that you also have different groups of Computer Languages... Functional Languages, like C and Pascal, Incremental Languages like Lisp and Scheme... and many more.legider_pb wrote:This isn't Basic, this isn't C, this isn't C++, and this isn't any other language available... This is PureBasic. A language loved by many and scoffed by few.


And how will you change the call of a function?techjunkie wrote:One more thing... It's practical with both Procedures AND Functions - then you instantly see if it the call has return value or not...
Code: Select all
DefFunction Test(a,b)
EndFunction a*b
debug Fn Test(a,b)Code: Select all
Procedure.l ThisReturn(a,b,c)
procedurereturn A*b*C
endprocedure
Procedure ThisNot(A,b,c)
debug A*B*C
endprocedureCode: Select all
Procedure.l FN_ThisReturn(a,b,c)
procedurereturn A*b*C
endprocedure
Procedure ThisNot(A,b,c)
debug A*B*C
endprocedure
It's very simple... Look in any computer term lexicon and you have the answer...GPI wrote:It is on you, how you will solve this "problem".
GPI
So PureBasic Procedures aren't really Procedures at all if you look at it from a strict Computer Science background...Function <programming> Computing usage derives from the mathematical term but is much less strict. In programming (except in functional programming), a function may return different values each time it is called with the same argument values and may have side effects.
A procedure is a function which returns no value but has only side-effects. The C language, for example, has no procedures, only functions. ANSI C even defines a type, void, for the result of a function that has no result.


I don't see a problem - I just like things to be called what they are when there is a name for it...GPI wrote:And a again: You see a problem, where no one is.


*LOL*GPI wrote:In PureBasic so many things are not-standard, for example Mid(): It should be Mid$().


Well, I'll guess I'm to old... *LOL* You can't make old dogs shit - or what do you say?Karbon wrote:Tech: It seems you live in the world of academia, where you evidently have the time and inclination to worry about such things..
Personally, I couldn't care less...
