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
>
>
> --
>
> 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
> 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
> 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
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
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?
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
> 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
--
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
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
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
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
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
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?
>
> 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
> 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(
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
---
17 matches
Mail list logo