Re: [Gambas-user] Close If Clicked Outside Form

2017-05-04 Thread Tobias Boege
On Thu, 04 May 2017, herberth guzman wrote:
> Hi
> 
> Close If Clicked Outside Form
> 
> Is there any way to close a form if it is clicked outside the main form?
> 
> For example, just as applets on the network or audio volume or KDE menu.
> 

Try the Deactivate event. The documentation doesn't really state what it
means for a window to be "deactivated" but a quick test shows that this
event is raised when the window ceases to be... the active one, e.g. when
you click outside of it or select another window by Alt+Tab (on my desktop
at least).

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Close If Clicked Outside Form

2017-05-04 Thread herberth guzman
Hi

Close If Clicked Outside Form

Is there any way to close a form if it is clicked outside the main form?

For example, just as applets on the network or audio volume or KDE menu.

Thanks


Herberth Guzman
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] transparency on rotated image

2017-05-04 Thread Leon Davis
Using Gambas v3.9.2 and GTK+3

After I rotate an image "Image.Rotate(0.03)" I get a background I can't get
rid of. Bug or Feature? Thank you for any assistance.

Leon
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Math Operation

2017-05-04 Thread cheikh diabang
I think the copy is not necessary. I want just access in one element on return 
array. Thank for your help



De : Jussi Lahtinen 
Envoyé : jeudi 4 mai 2017 15:12
À : mailing list for gambas users
Objet : Re: [Gambas-user] Math Operation

Declare the function as:

Function calcul_coefficients(x As Integer, y As Integer, degre As Integer)
As Float[]

Then return the answer as (this is for convenience as copy returns new
object instance):

Return [a, b, c].Copy()




Jussi

On Thu, May 4, 2017 at 5:41 PM, cheikh diabang 
wrote:

> Hi ! i wanna know how recover return value of function in my case.
>
> I do that as below, but he said object expected
>
>  calcul_coefficients(j, iy_v_c_w, 2)
>coeff_v_c_w_0 = calcul_coefficients[2]
>coeff_v_c_w_1 = calcul_coefficients[1]
>coeff_v_c_w_2 = calcul_coefficients[0]
>
> Thank for help.
>
> 
> De : cheikh diabang 
> Envoyé : jeudi 4 mai 2017 10:42
> À : mailing list for gambas users
> Objet : Re: [Gambas-user] Math Operation
>
> Thank you very much Julio Sanchez . Its working fine
>
>
> 
> De : Julio Sanchez 
> Envoyé : jeudi 4 mai 2017 10:30
> À : mailing list for gambas users
> Objet : Re: [Gambas-user] Math Operation
>
> cheikh diabang:
>
> In addition if you are going to return several float values, you should put
> float[]...
>
> Function calcul_coefficients(x As Integer, y As Integer, degre As Integer)
> As Float[]
>
> 
> Dim ArrayABC as new float[]
> 
> .
> ArrayABC.add(A)
> ArrayABC.add(B)
> ArrayABC.add(C)
>
> Return ArrayABC
>
>
>
> Regards,
>
> Julio
>
> 2017-05-04 12:13 GMT+02:00 Tobias Boege :
>
> > On Thu, 04 May 2017, cheikh diabang wrote:
> > > hello. i have write this code below on gambas 3.9.2 and when i run
> that,
> > he indique syntaxe error
> > >
> > >
> > > Function calcul_coefficients(x As Integer, y As Integer, degre As
> > Integer) As Float
> > >   'Dim ak As Float
> > >   Dim a As Float
> > >   Dim b As Float
> > >   Dim c As Float
> > >   Dim nbr_coef As Integer
> > >   Dim k As Integer
> > >
> > >   nbr_coef = degre + 1
> > >For k = 0 To degre
> > > If k == 0
> > > 'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> > (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > >   c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> > (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > > Else If k == 1
> > >   b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> > ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > > Else If k == 2
> > >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> > ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > > Else
> > >   Message.Info("unavalaible coefficients")
> > >Next
> > >Return a, b, c
> > > End
> > >
> > >
> > > But i see nothing as error. I need help please
> >
> > Look closer:
> >
> > >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> > ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > >   2(1 / (k + 1))
> >
> > Since "2" is not a function, you have to write
> >
> >   2*(1 / (k + 1))
> >
> > Regards,
> > Tobi
> >
> > --
> > "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> >
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


> Gambas-user Info Page - lists.sourceforge.net lists.sourceforge.net/lists/listinfo/gambas-user>
> lists.sourceforge.net
> To see the collection of prior postings to the list, visit the Gambas-user
> Archives. Using Gambas-user: To post a message to all the list members ...
>
>
> Gambas-user Info Page - lists.sourceforge.net lists.sourceforge.net/lists/listinfo/gambas-user>
> lists.sourceforge.net
> To see the collection of prior postings to the list, visit the Gambas-user
> Archives. Using Gambas-user: To post a message to all the list members ...
>
>
> >
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! 

Re: [Gambas-user] Math Operation

2017-05-04 Thread Jussi Lahtinen
Declare the function as:

Function calcul_coefficients(x As Integer, y As Integer, degre As Integer)
As Float[]

Then return the answer as (this is for convenience as copy returns new
object instance):

Return [a, b, c].Copy()




Jussi

On Thu, May 4, 2017 at 5:41 PM, cheikh diabang 
wrote:

> Hi ! i wanna know how recover return value of function in my case.
>
> I do that as below, but he said object expected
>
>  calcul_coefficients(j, iy_v_c_w, 2)
>coeff_v_c_w_0 = calcul_coefficients[2]
>coeff_v_c_w_1 = calcul_coefficients[1]
>coeff_v_c_w_2 = calcul_coefficients[0]
>
> Thank for help.
>
> 
> De : cheikh diabang 
> Envoyé : jeudi 4 mai 2017 10:42
> À : mailing list for gambas users
> Objet : Re: [Gambas-user] Math Operation
>
> Thank you very much Julio Sanchez . Its working fine
>
>
> 
> De : Julio Sanchez 
> Envoyé : jeudi 4 mai 2017 10:30
> À : mailing list for gambas users
> Objet : Re: [Gambas-user] Math Operation
>
> cheikh diabang:
>
> In addition if you are going to return several float values, you should put
> float[]...
>
> Function calcul_coefficients(x As Integer, y As Integer, degre As Integer)
> As Float[]
>
> 
> Dim ArrayABC as new float[]
> 
> .
> ArrayABC.add(A)
> ArrayABC.add(B)
> ArrayABC.add(C)
>
> Return ArrayABC
>
>
>
> Regards,
>
> Julio
>
> 2017-05-04 12:13 GMT+02:00 Tobias Boege :
>
> > On Thu, 04 May 2017, cheikh diabang wrote:
> > > hello. i have write this code below on gambas 3.9.2 and when i run
> that,
> > he indique syntaxe error
> > >
> > >
> > > Function calcul_coefficients(x As Integer, y As Integer, degre As
> > Integer) As Float
> > >   'Dim ak As Float
> > >   Dim a As Float
> > >   Dim b As Float
> > >   Dim c As Float
> > >   Dim nbr_coef As Integer
> > >   Dim k As Integer
> > >
> > >   nbr_coef = degre + 1
> > >For k = 0 To degre
> > > If k == 0
> > > 'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> > (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > >   c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> > (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > > Else If k == 1
> > >   b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> > ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > > Else If k == 2
> > >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> > ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > > Else
> > >   Message.Info("unavalaible coefficients")
> > >Next
> > >Return a, b, c
> > > End
> > >
> > >
> > > But i see nothing as error. I need help please
> >
> > Look closer:
> >
> > >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> > ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > >   2(1 / (k + 1))
> >
> > Since "2" is not a function, you have to write
> >
> >   2*(1 / (k + 1))
> >
> > Regards,
> > Tobi
> >
> > --
> > "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> >
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> Gambas-user Info Page - lists.sourceforge.net lists.sourceforge.net/lists/listinfo/gambas-user>
> lists.sourceforge.net
> To see the collection of prior postings to the list, visit the Gambas-user
> Archives. Using Gambas-user: To post a message to all the list members ...
>
>
> Gambas-user Info Page - lists.sourceforge.net lists.sourceforge.net/lists/listinfo/gambas-user>
> lists.sourceforge.net
> To see the collection of prior postings to the list, visit the Gambas-user
> Archives. Using Gambas-user: To post a message to all the list members ...
>
>
> >
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> Gambas-user Info Page - lists.sourceforge.net lists.sourceforge.net/lists/listinfo/gambas-user>
> lists.sourceforge.net
> To see the collection of prior postings to the list, visit the Gambas-user
> Archives. Using Gambas-user: To post a message to all the list members ...
>
>
> Gambas-user Info Page - lists.sourceforge.net 

Re: [Gambas-user] Math Operation

2017-05-04 Thread cheikh diabang
Hi ! i wanna know how recover return value of function in my case.

I do that as below, but he said object expected

 calcul_coefficients(j, iy_v_c_w, 2)
   coeff_v_c_w_0 = calcul_coefficients[2]
   coeff_v_c_w_1 = calcul_coefficients[1]
   coeff_v_c_w_2 = calcul_coefficients[0]

Thank for help.


De : cheikh diabang 
Envoyé : jeudi 4 mai 2017 10:42
À : mailing list for gambas users
Objet : Re: [Gambas-user] Math Operation

Thank you very much Julio Sanchez . Its working fine



De : Julio Sanchez 
Envoyé : jeudi 4 mai 2017 10:30
À : mailing list for gambas users
Objet : Re: [Gambas-user] Math Operation

cheikh diabang:

In addition if you are going to return several float values, you should put
float[]...

Function calcul_coefficients(x As Integer, y As Integer, degre As Integer)
As Float[]


Dim ArrayABC as new float[]

.
ArrayABC.add(A)
ArrayABC.add(B)
ArrayABC.add(C)

Return ArrayABC



Regards,

Julio

2017-05-04 12:13 GMT+02:00 Tobias Boege :

> On Thu, 04 May 2017, cheikh diabang wrote:
> > hello. i have write this code below on gambas 3.9.2 and when i run that,
> he indique syntaxe error
> >
> >
> > Function calcul_coefficients(x As Integer, y As Integer, degre As
> Integer) As Float
> >   'Dim ak As Float
> >   Dim a As Float
> >   Dim b As Float
> >   Dim c As Float
> >   Dim nbr_coef As Integer
> >   Dim k As Integer
> >
> >   nbr_coef = degre + 1
> >For k = 0 To degre
> > If k == 0
> > 'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> >   c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else If k == 1
> >   b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else If k == 2
> >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else
> >   Message.Info("unavalaible coefficients")
> >Next
> >Return a, b, c
> > End
> >
> >
> > But i see nothing as error. I need help please
>
> Look closer:
>
> >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> >   2(1 / (k + 1))
>
> Since "2" is not a function, you have to write
>
>   2*(1 / (k + 1))
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 

Re: [Gambas-user] Math Operation

2017-05-04 Thread cheikh diabang
Thank you very much Julio Sanchez . Its working fine



De : Julio Sanchez 
Envoyé : jeudi 4 mai 2017 10:30
À : mailing list for gambas users
Objet : Re: [Gambas-user] Math Operation

cheikh diabang:

In addition if you are going to return several float values, you should put
float[]...

Function calcul_coefficients(x As Integer, y As Integer, degre As Integer)
As Float[]


Dim ArrayABC as new float[]

.
ArrayABC.add(A)
ArrayABC.add(B)
ArrayABC.add(C)

Return ArrayABC



Regards,

Julio

2017-05-04 12:13 GMT+02:00 Tobias Boege :

> On Thu, 04 May 2017, cheikh diabang wrote:
> > hello. i have write this code below on gambas 3.9.2 and when i run that,
> he indique syntaxe error
> >
> >
> > Function calcul_coefficients(x As Integer, y As Integer, degre As
> Integer) As Float
> >   'Dim ak As Float
> >   Dim a As Float
> >   Dim b As Float
> >   Dim c As Float
> >   Dim nbr_coef As Integer
> >   Dim k As Integer
> >
> >   nbr_coef = degre + 1
> >For k = 0 To degre
> > If k == 0
> > 'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> >   c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else If k == 1
> >   b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else If k == 2
> >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else
> >   Message.Info("unavalaible coefficients")
> >Next
> >Return a, b, c
> > End
> >
> >
> > But i see nothing as error. I need help please
>
> Look closer:
>
> >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> >   2(1 / (k + 1))
>
> Since "2" is not a function, you have to write
>
>   2*(1 / (k + 1))
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Math Operation

2017-05-04 Thread Julio Sanchez
cheikh diabang:

In addition if you are going to return several float values, you should put
float[]...

Function calcul_coefficients(x As Integer, y As Integer, degre As Integer)
As Float[]


Dim ArrayABC as new float[]

.
ArrayABC.add(A)
ArrayABC.add(B)
ArrayABC.add(C)

Return ArrayABC



Regards,

Julio

2017-05-04 12:13 GMT+02:00 Tobias Boege :

> On Thu, 04 May 2017, cheikh diabang wrote:
> > hello. i have write this code below on gambas 3.9.2 and when i run that,
> he indique syntaxe error
> >
> >
> > Function calcul_coefficients(x As Integer, y As Integer, degre As
> Integer) As Float
> >   'Dim ak As Float
> >   Dim a As Float
> >   Dim b As Float
> >   Dim c As Float
> >   Dim nbr_coef As Integer
> >   Dim k As Integer
> >
> >   nbr_coef = degre + 1
> >For k = 0 To degre
> > If k == 0
> > 'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> >   c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^
> (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else If k == 1
> >   b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else If k == 2
> >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> > Else
> >   Message.Info("unavalaible coefficients")
> >Next
> >Return a, b, c
> > End
> >
> >
> > But i see nothing as error. I need help please
>
> Look closer:
>
> >   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x
> ^ (- (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> >   2(1 / (k + 1))
>
> Since "2" is not a function, you have to write
>
>   2*(1 / (k + 1))
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Math Operation

2017-05-04 Thread cheikh diabang
Thank Tobias its working well. But Return the tree values have problem whit 
mark","

The last change is below

Function calcul_coefficients(x As Integer, y As Integer, degre As Integer) As 
Float
  'Dim ak As Float
  Dim a As Float
  Dim b As Float
  Dim c As Float
  Dim nbr_coef As Integer
  Dim k As Integer

  nbr_coef = degre + 1
  For k = 0 To degre
If k == 0
'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k - 
1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
  c = (nbr_coef ^ k * ((x ^ (2 * (1 / (k + 1 * y) - (x * (y * (x ^ (- 
(k - 1)) / ((nbr_coef * x ^ 2) - (x ^ 2))
Else If k == 1
  b = ((nbr_coef ^ k) * ((x ^ (2 * (1 / (k + 1 * y) - (x * (y * (x ^ (- 
(k - 1)) / ((nbr_coef * x ^ 2) - (x ^ 2))
Else If k == 2
  a = ((nbr_coef ^ k) * ((x ^ (2 * (1 / (k + 1 * y) - (x * (y * (x ^ (- 
(k - 1)) / ((nbr_coef * x ^ 2) - (x ^ 2))
Else
 Message.Info("unavalaible coefficients")
Endif
  Next
   Return a, b, c;
End




De : Tobias Boege 
Envoyé : jeudi 4 mai 2017 10:13
À : mailing list for gambas users
Objet : Re: [Gambas-user] Math Operation

On Thu, 04 May 2017, cheikh diabang wrote:
> hello. i have write this code below on gambas 3.9.2 and when i run that, he 
> indique syntaxe error
>
>
> Function calcul_coefficients(x As Integer, y As Integer, degre As Integer) As 
> Float
>   'Dim ak As Float
>   Dim a As Float
>   Dim b As Float
>   Dim c As Float
>   Dim nbr_coef As Integer
>   Dim k As Integer
>
>   nbr_coef = degre + 1
>For k = 0 To degre
> If k == 0
> 'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k 
> - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
>   c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k 
> - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> Else If k == 1
>   b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- 
> (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> Else If k == 2
>   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- 
> (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> Else
>   Message.Info("unavalaible coefficients")
>Next
>Return a, b, c
> End
>
>
> But i see nothing as error. I need help please

Look closer:

>   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- 
> (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
>   2(1 / (k + 1))

Since "2" is not a function, you have to write

  2*(1 / (k + 1))

Regards,
Tobi

--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
Gambas-user Info Page - 
lists.sourceforge.net
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Gambas-user 
Archives. Using Gambas-user: To post a message to all the list members ...


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Math Operation

2017-05-04 Thread Tobias Boege
On Thu, 04 May 2017, cheikh diabang wrote:
> hello. i have write this code below on gambas 3.9.2 and when i run that, he 
> indique syntaxe error
> 
> 
> Function calcul_coefficients(x As Integer, y As Integer, degre As Integer) As 
> Float
>   'Dim ak As Float
>   Dim a As Float
>   Dim b As Float
>   Dim c As Float
>   Dim nbr_coef As Integer
>   Dim k As Integer
> 
>   nbr_coef = degre + 1
>For k = 0 To degre
> If k == 0
> 'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k 
> - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
>   c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k 
> - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> Else If k == 1
>   b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- 
> (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> Else If k == 2
>   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- 
> (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
> Else
>   Message.Info("unavalaible coefficients")
>Next
>Return a, b, c
> End
> 
> 
> But i see nothing as error. I need help please

Look closer:

>   a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- 
> (k - 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
>   2(1 / (k + 1))

Since "2" is not a function, you have to write

  2*(1 / (k + 1))

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas binary to ELF?

2017-05-04 Thread Tobias Boege
On Thu, 04 May 2017, alexchernoff wrote:
> Good day all,
> 
> anyone know of a way to make an ELF format file from Gambas executable?
> 
> I try a "software protection" system (WIBU KEY), to protect a Gambas project
> from unwanted copying, but it can only protect ELF binaries and doesn't
> recognize a Gambas executable.
> 
> Cheers!
> 

The, AFAIK, only Gambas compiler, gbc3, produces Gambas bytecode files which
are not ELF, as you know. There is a gb.jit component with an LLVM-based JIT
compiler. Maybe this contains all the necessary gears already to compile a
Gambas project's instructions to host system opcodes. But then you would
still have to take care of linking, especially interfacing with components
written in Gambas. It sounds like some work.

This may look like a trivial answer, but if you can protect absolutely every
ELF file as long as it's in the ELF format, just pack an archive of the
Gambas bytecode together with a copy of the interpreter executable inside
an ELF executable. That outer executable works like a self-extracting
archive: it extracts the Gambas bytecode and the interpreter and runs the
interpreter on the bytecode. Voila, the working Gambas program inside ELF.

You can easily achieve this by writing some template code for the self-
extracting archive and then embedding the compiler and the archive into
its .data section.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Math Operation

2017-05-04 Thread cheikh diabang
hello. i have write this code below on gambas 3.9.2 and when i run that, he 
indique syntaxe error


Function calcul_coefficients(x As Integer, y As Integer, degre As Integer) As 
Float
  'Dim ak As Float
  Dim a As Float
  Dim b As Float
  Dim c As Float
  Dim nbr_coef As Integer
  Dim k As Integer

  nbr_coef = degre + 1
   For k = 0 To degre
If k == 0
'ak = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k - 
1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
  c = (nbr_coef ^ k * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k - 
1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
Else If k == 1
  b = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k 
- 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
Else If k == 2
  a = ((nbr_coef ^ k) * ((x ^ (2(1 / (k + 1 * y) - (x * (y * (x ^ (- (k 
- 1)) / ((nbr_coef * x ^ 2) - ((x) ^ 2))
Else
  Message.Info("unavalaible coefficients")
   Next
   Return a, b, c
End


But i see nothing as error. I need help please
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Gambas binary to ELF?

2017-05-04 Thread alexchernoff
Good day all,

anyone know of a way to make an ELF format file from Gambas executable?

I try a "software protection" system (WIBU KEY), to protect a Gambas project
from unwanted copying, but it can only protect ELF binaries and doesn't
recognize a Gambas executable.

Cheers!





--
View this message in context: 
http://gambas.8142.n7.nabble.com/Gambas-binary-to-ELF-tp58891.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user