Le 17/03/2012 18:48, Randall Morgan a écrit :
> Tried that, didn't work. I got the same errors
>
Sorry, I gave you the Gambas 2 syntax.
You must do:
If TypeOf(Result) = gb.Object And If Result Is Array Then ...
But why didn't you try the second solution?
--
Benoît Minisini
--
Tried that, didn't work. I got the same errors
On Sat, Mar 17, 2012 at 10:45 AM, Emil Lenngren wrote:
> You need to use "And If", not only "And".
> http://gambasdoc.org/help/lang/andif?v3
>
> /Emil
>
> 2012/3/17 Randall Morgan
>
> > Hi Benoit,
> >
> > I tried the code below and I get errors. If
You need to use "And If", not only "And".
http://gambasdoc.org/help/lang/andif?v3
/Emil
2012/3/17 Randall Morgan
> Hi Benoit,
>
> I tried the code below and I get errors. If I use:
>
> if result Is Array Then
>
> I get a type error.
>
> If I use:
>
> if IsObject(result) And result Is Array Then
Hi Benoit,
I tried the code below and I get errors. If I use:
if result Is Array Then
I get a type error.
If I use:
if IsObject(result) And result Is Array Then
I get an identifier error IsObject unknown identifier.
I just updated my code base and recompiled and still have these errors. I
a
I'm using:
gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
On this machine. I think I hav
Le 16/03/2012 18:35, Randall Morgan a écrit :
> I am aware of the warnings. But needed to check in my code so I would have
> access to it from another location. You had told me before it was ok to
> check in code that contained errors or was incomplete. I then got
> distracted and also was hoping t
I am aware of the warnings. But needed to check in my code so I would have
access to it from another location. You had told me before it was ok to
check in code that contained errors or was incomplete. I then got
distracted and also was hoping to hear back from on some of my questions.
But never di
Le 16/03/2012 04:14, Randall Morgan a écrit :
> Hi,
>
> I am writing a small test suit and need to tell is the result I got back
> from a function is an array of some type.
> Does anyone have a solution for this?
>
> Thanks
>
You can do like that:
Dim Result As Variant
Result = T
You can see the code in the gb.gsl/test folder. However that code does not
contain the code I am working on at the moment. I have not committed it
yet.
What I am trying to accomplish is to create a test framework that can be
used for any type of data or object. So that the general framework is
gen
Hi,
It's probably worth putting in a check for TypeOf(my_var) = gb.Object
(16) before doing the Is Array check...
(From the documentation):
Expression type
Return value
NULL
gb.Null=15
Boolean
gb.Boolean=1
Byte
gb.Byte=2
Short
gb.Short=3
Integer
gb.Integer=4
Long
gb.Long=5
The line containing the if statement. It is the "Is" keyword that fail
somehow If I change it to = or some other expression I get results I
would expect.
-> if expected Is Array Then ---> Error: "Expected Object got boolean"
I am already using TypeOf to test the type of the results. What
That kind of code should work, I think... On what line is the error?
2012/3/16 Randall Morgan
> The code is for a test framework. I am currently on the wrong machine to
> send the code. But it's something like this:
>
> Dim result As Variant
> Dim expected As Variant
> Dim i As Integer
> Dim isE
The code is for a test framework. I am currently on the wrong machine to
send the code. But it's something like this:
Dim result As Variant
Dim expected As Variant
Dim i As Integer
Dim isEqual As Boolean
result = myFunction() As Variant
if Typeof(result) = Typeof(expected) Then
isEqual = Tru
How does your code look like?
A boolean is certainly not an array... :)
/Emil
2012/3/16 Randall Morgan
> That works as long as a is an array. But it a is an a boolean then I get an
> error "Object expected but got boolean" or float, ect...
>
> I too thought it should work that way. Mybe there i
That works as long as a is an array. But it a is an a boolean then I get an
error "Object expected but got boolean" or float, ect...
I too thought it should work that way. Mybe there is a bug in the Gambas or
my code?
On Fri, Mar 16, 2012 at 3:34 AM, Emil Lenngren wrote:
> Dim a As New String[
Dim a As New String[]
Print a Is Array
should work I think...
2012/3/16 Randall Morgan
> Hi,
>
> I am writing a small test suit and need to tell is the result I got back
> from a function is an array of some type.
> Does anyone have a solution for this?
>
> Thanks
>
> --
> If you ask me if it c
Hi,
I am writing a small test suit and need to tell is the result I got back
from a function is an array of some type.
Does anyone have a solution for this?
Thanks
--
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cos
17 matches
Mail list logo