Re: [Gambas-user] To wish list; optional compiler warning

2011-09-11 Thread Jussi Lahtinen
Good choice. Jussi 2011/9/11 Benoît Minisini > > > > I think I go with the array solution, though I was hoping for something > > more elegant. > > > > Thanks, > > Jussi > > I know, but I usually sacrify elegance for performance. > > -- > Benoît Minisini > > > --

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-11 Thread Benoît Minisini
> > I think I go with the array solution, though I was hoping for something > more elegant. > > Thanks, > Jussi I know, but I usually sacrify elegance for performance. -- Benoît Minisini -- Using storage to extend the

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-11 Thread Jussi Lahtinen
> You are right with the fact that the compiler should issue a warning. But > it > cannot know everytime that the called function needs a ByRef, as soon as > the > function is in another class. Maybe I should have allowed ByRef in private > functions only... > OK, I understand. Maybe there should

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-11 Thread Benoît Minisini
> Problem is that my functions are like; ConnectThese(iWithTerm, ByRef > iVariable1, Byref iVariable2). > > Jussi > You are right with the fact that the compiler should issue a warning. But it cannot know everytime that the called function needs a ByRef, as soon as the function is in another c

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-11 Thread Jussi Lahtinen
Problem is that my functions are like; ConnectThese(iWithTerm, ByRef iVariable1, Byref iVariable2). Jussi 2011/9/11 Fabián Flores Vadell > 2011/9/10 Jussi Lahtinen > > > > > What is the alternative then? Pass variables as pointers? > > Making almost needless class for couple variables doesn't

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-11 Thread Fabián Flores Vadell
2011/9/10 Jussi Lahtinen > > What is the alternative then? Pass variables as pointers? > Making almost needless class for couple variables doesn't seem good > option... > > Jussi > Pass variables as pointer, will work (I think). But, ¿is necessary? Could you just use functions to return values?

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-11 Thread Fabián Flores Vadell
2011/9/9 Fabien Bodard > yes like : > > Private Function ModifyThat(byRef i as integer) as boolean > > i+=6*4 > > catch > return true > > end > > > > to use it > > if not Modifythat(ByRef iMyVal) Then Print iMyVal > > > sometime it can be usefull to catch the error in the calling function > I

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-10 Thread Jussi Lahtinen
> I added ByRef to Gambas only to help porting VB projects. In other cases, > just > don't use it, even if you find it more practical. > What is the alternative then? Pass variables as pointers? Making almost needless class for couple variables doesn't seem good option... Jussi --

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-10 Thread Jussi Lahtinen
I have no clue what this has to do with issue I'm talking about. Jussi On Sat, Sep 10, 2011 at 22:35, Fabien Bodard wrote: > 2011/9/9 Jussi Lahtinen : > > What's that supposed to do? > > Catch doesn't do catch anything since missing byref doesn't rise error! > > > > Jussi > > > it not for miss

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-10 Thread Fabien Bodard
2011/9/9 Jussi Lahtinen : > What's that supposed to do? > Catch doesn't do catch anything since missing byref doesn't rise error! > > Jussi > it not for missing data but for the routine that modify the byref data ... if this algoritm fail ... it return true so i know if the byref value have been mo

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-09 Thread Jussi Lahtinen
What's that supposed to do? Catch doesn't do catch anything since missing byref doesn't rise error! Jussi On Fri, Sep 9, 2011 at 22:51, Fabien Bodard wrote: > yes like : > > Private Function ModifyThat(byRef i as integer) as boolean > > i+=6*4 > > catch > return true > > end > > > > to use i

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-09 Thread Fabien Bodard
yes like : Private Function ModifyThat(byRef i as integer) as boolean i+=6*4 catch return true end to use it if not Modifythat(ByRef iMyVal) Then Print iMyVal sometime it can be usefull to catch the error in the calling function 2011/9/9 Jussi Lahtinen : > After I read what Fabie

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-09 Thread Jussi Lahtinen
After I read what Fabien wrote, I realised what you meant and I think you misunderstood my problem. My problem is *not *that I have to write byref to function declaration and to function call. My problem is that if I forget to write byref to function call, I will get silent bugs. I think either b

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-08 Thread Fabián Flores Vadell
2011/9/8 Jussi Lahtinen > > > > By having to specify ByRef in the caller, you can't forget that the > > function > > will modify your variable (forgetting that leads to hard-to-fix bugs) and > > it > > help readers of your code. > > > > Sorry, I don't understand what you mean, can you elaborate?

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-08 Thread Jussi Lahtinen
> > By having to specify ByRef in the caller, you can't forget that the > function > will modify your variable (forgetting that leads to hard-to-fix bugs) and > it > help readers of your code. > Sorry, I don't understand what you mean, can you elaborate? I mean I forgot to write Test(Byref i), ins

Re: [Gambas-user] To wish list; optional compiler warning

2011-09-08 Thread Benoît Minisini
> Hi! > Quick thought; it would be nice to have compiler warning if "byref" is > missing from function/sub call. > I know using byref is optional, but so far I have only forgot to add it. > > Example: > > Private Sub Test(Byref x As Integer) > ... > > And you can call it; > Test(i) > Or; > Test(

[Gambas-user] To wish list; optional compiler warning

2011-09-08 Thread Jussi Lahtinen
Hi! Quick thought; it would be nice to have compiler warning if "byref" is missing from function/sub call. I know using byref is optional, but so far I have only forgot to add it. Example: Private Sub Test(Byref x As Integer) ... And you can call it; Test(i) Or; Test(Byref i) Jussi ---