found interesting bug

View: New views
3 Messages — Rating Filter:   Alert me  

found interesting bug

by kobolds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 I found very interesting bug . here how to emulate it (took me a while to trace it)

1 . create 2 module

module Mtest1

public function test() as boolean

  error.raise("this is error 1")

  return true
catch
  Mtest2.test2(error.text)
  return false
end

'__________________________________
module Mtest2

public function test2(arg_msg as string)
   message.error(arg_msg)
end


when you run you will notice message.error show nothing . the message ""this is error 1" lose .
solution 1

module Mtest1

public function test() as boolean
  dim m_err as string
  error.raise("this is error 1")

  return true
catch
  m_err = error.text
  Mtest2.test2(m_err)
  return false
end

'__________________________________
module Mtest2

public function test2(arg_msg as string)
   message.error(arg_msg)
end


solution 2

module Mtest1

public function test() as boolean
  dim m_err as string
  error.raise("this is error 1")

  return true
catch
  m_err = error.text
  Mtest2.test2(m_err)
  return false
end

public function test2(arg_msg as string)
   message.error(arg_msg)
end






is this a bug or not ?

Re: found interesting bug

by Benoît Minisini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>  I found very interesting bug . here how to emulate it (took me a while to
> trace it)
>
> 1 . create 2 module
>
> module Mtest1
>
> public function test() as boolean
>
>   error.raise("this is error 1")
>
>   return true
> catch
>   Mtest2.test2(error.text)
>   return false
> end
>
> '__________________________________
> module Mtest2
>
> public function test2(arg_msg as string)
>    message.error(arg_msg)
> end
>
>
> when you run you will notice message.error show nothing . the message
> ""this is error 1" lose .
> solution 1
>
> module Mtest1
>
> public function test() as boolean
>   dim m_err as string
>   error.raise("this is error 1")
>
>   return true
> catch
>   m_err = error.text
>   Mtest2.test2(m_err)
>   return false
> end
>
> '__________________________________
> module Mtest2
>
> public function test2(arg_msg as string)
>    message.error(arg_msg)
> end
>
>
> solution 2
>
> module Mtest1
>
> public function test() as boolean
>   dim m_err as string
>   error.raise("this is error 1")
>
>   return true
> catch
>   m_err = error.text
>   Mtest2.test2(m_err)
>   return false
> end
>
> public function test2(arg_msg as string)
>    message.error(arg_msg)
> end
>
>
>
>
>
>
> is this a bug or not ?

Which version of Gambas do you use? Which GUI component do you use?

--
Benoît

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: found interesting bug

by kobolds :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gambas 2.14
gui qt


Benoît Minisini wrote:
>  I found very interesting bug . here how to emulate it (took me a while to
> trace it)
>
> 1 . create 2 module
>
> module Mtest1
>
> public function test() as boolean
>
>   error.raise("this is error 1")
>
>   return true
> catch
>   Mtest2.test2(error.text)
>   return false
> end
>
> '__________________________________
> module Mtest2
>
> public function test2(arg_msg as string)
>    message.error(arg_msg)
> end
>
>
> when you run you will notice message.error show nothing . the message
> ""this is error 1" lose .
> solution 1
>
> module Mtest1
>
> public function test() as boolean
>   dim m_err as string
>   error.raise("this is error 1")
>
>   return true
> catch
>   m_err = error.text
>   Mtest2.test2(m_err)
>   return false
> end
>
> '__________________________________
> module Mtest2
>
> public function test2(arg_msg as string)
>    message.error(arg_msg)
> end
>
>
> solution 2
>
> module Mtest1
>
> public function test() as boolean
>   dim m_err as string
>   error.raise("this is error 1")
>
>   return true
> catch
>   m_err = error.text
>   Mtest2.test2(m_err)
>   return false
> end
>
> public function test2(arg_msg as string)
>    message.error(arg_msg)
> end
>
>
>
>
>
>
> is this a bug or not ?

Which version of Gambas do you use? Which GUI component do you use?

--
Benoît

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user