You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

JMOODY

Beginner

  • "JMOODY" started this thread

Posts: 7

Date of registration: Mar 24th 2009

  • Send private message

1

Tuesday, March 24th 2009, 2:20pm

Bug Report: Arithmetic operations

Hi Manuel,

Wow this is great to be able to compile into Java for the first time.

I note that arithmetic operations using a carat mark such as

msgbox( 3^2 + 7)

or

msgbox( 7 + 3^2)

ARE supported, but give the WRONG ANSWER. Both should give 16, but the first gives a real number larger than 1000 and the second gives the integer 100.

------------------------------------------------------------------------------------------

Secondly, it is annoying but it keeps asking the resources to be relocated, it will say it cannot find the field "bitmap.gif" and when I browse to it again it will create a new file "bitmap2.gif." Next run it cannot find "bitmap2.gif" so it creates "bitmap3.gif" and so-on. It seems often unable to recognize that resourcse are there. This is running in Vista.

John




Amazing piece of software, you must have good people who helped you create this :thumbsup:

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

2

Tuesday, March 24th 2009, 2:31pm

Operator Priorities

Hi,
this seems to be a problem of arithmetic operator priorities.

If you use brackets, you get the correct results:

msgbox( (3^2) + 7)

msgbox( 7 + (3^2))

Currently, Jabaco is evaluating the following instead:

msgbox( 3^(2 + 7))

msgbox( (7 + 3)^2)

So, the error is that the priority of "^" is equal to that of "+". It should be higher.

Cheers!

A1880

This post has been edited 1 times, last edit by "A1880" (Mar 25th 2009, 11:50pm)


Manuel

Administrator

  • "Manuel" is male

Posts: 256

Date of registration: Jul 16th 2008

Location: Erlangen, Germany

Occupation: Software Developer

Hobbies: Jabaco, game theory, text-mining

  • Send private message

3

Tuesday, March 24th 2009, 3:04pm

Quoted

ARE supported, but give the WRONG ANSWER. Both should give 16, but the first gives a real number larger than 1000 and the second gives the integer 100.

Quoted

So, the error is that the priority of "^" is equal to that of "+". It should be higher.
Thank you. I forgot to set the priority for "^"

Quoted

Secondly, it is annoying but it keeps asking the resources to be relocated, it will say it cannot find the field "bitmap.gif" and when I browse to it again it will create a new file "bitmap2.gif." Next run it cannot find "bitmap2.gif" so it creates "bitmap3.gif" and so-on. It seems often unable to recognize that resourcse are there. This is running in Vista.
Could you specify the steps to reproduce this problem?

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

4

Tuesday, March 24th 2009, 5:04pm

Hi Manuel, Hi John,

did you see this:

Resources

there is another trap, due to a bug in Jabaco.

To avoid this behaviour follow these steps:

* copy all your resources you want to integrate in your Jabaco project to a folder beside
or outside of your Jabaco project folder

* in Jabaco, open your jabaco project and delete alle resources from the project
save the project and close Jabaco

* in the folder of your jabaco project delete all resources and if there is a res-directory delete this
res-directory from your project folder.

* restart Jabaco with your project, and load the resources from the folder outside of your
jabaco project.

explanation:
Jabaco has problems if the resource-file that you want to integrate and open as a resource, already exists in your project folder or in the res folder.

greetings

OlimilO

This post has been edited 2 times, last edit by "OlimilO" (Mar 24th 2009, 9:10pm)


JMOODY

Beginner

  • "JMOODY" started this thread

Posts: 7

Date of registration: Mar 24th 2009

  • Send private message

5

Wednesday, March 25th 2009, 7:43pm

Wow, thanks for the fast response! That explains both behaviors. Also...

Wow, thanks for the fast response. That explains both behaviours (priority of operations and the way Jabaco prefers to keep application folders separate).

Two other very small things:

1) I am trying three ways to make the form backcolor completely transparent (so I can use a gif to make the form another shape besides square. None of these work:

- setting the background color programmatically to rgb(0,0,0,0) with 0 for alpha as the last entry
- trying to access java#awt#color
- setting transparent to 0 in the form properties box.

I also tried decompiling some of the java class files.

2) What event fires when a form is unloaded (closed)? What if a user for instance wants to do actions when the user closees a form? Should I read an existing page here to figure that out?


JM

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

6

Wednesday, March 25th 2009, 11:26pm

Form exit

Hi,
a "Form" inherits from class "AbstractForm".

In the source of AbstractForm you can find:

Source code

1
2
3
Public Sub SetDefaultClose()
   Me.setDefaultCloseOperation( Me.EXIT_ON_CLOSE )
End Sub


This method is called by default in "Module1" of a standard Jabaco project:

Source code

1
2
3
4
5
6
7
8
Public Form1 As New Form1

Public Sub main(ByJava args() As String)
   Dim myArgs() As String
   myArgs = args
   Form1.SetDefaultClose()
   Form1.show()
End Sub


If you comment out (or leave out) the line "Form1.SetDefaultClose()" a user abort will cause an event you can intercept:

Source code

1
2
3
Public Sub Form_Deactivate()
   msgbox "Deactivated!"
End Sub


Well, for me it would be nicer to have a more VB6 like situation. So my suggestion would be to add an unload event for Forms in the Jabaco framework.

Try it out!

A1880

JMOODY

Beginner

  • "JMOODY" started this thread

Posts: 7

Date of registration: Mar 24th 2009

  • Send private message

7

Thursday, March 26th 2009, 1:09pm

Thanks again!

Wow, thanks for that quick answer. That is great; I had not noticed that there was a "module 1" and associated code. I think it is fine to leave it like that, it does not have to be exactly the same as VB6.

The only reason I wanted transparency was to use a form with no border, and make my own task bar in order to have my own button to close the form, and I would put Deactivate code there. This is simpler, I can use the Deactivate routine that appears when the default action in module 1 is commented out. Perfect!

I still am somewhat curious if it is possible to change the form background to transparent, even though there is no particular reason to do that now. As I say, I tried to find a number in Form1.class which might be the RGB( , , , ) code but was unable to find it.

Another comment: I note all the class files which might conceivably be used by any project are included in the JAR file of every project. The JAR files would be very small if only necessary class files were included. I wonder what is the reason for including them all? As Jabaco becomes more popular there will be program users with many many copies of each class file on their home computers....

JM

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

8

Thursday, March 26th 2009, 4:13pm

Hi JMOODY,

Quoted

Another comment: I note all the class files which might conceivably be used by any project are included in the JAR file of every project. The JAR files would be very small if only necessary class files were included. I wonder what is the reason for including them all? As Jabaco becomes more popular there will be program users with many many copies of each class file on their home computers....



Yes I would agree with you, it should be possible to decide wheter the Jabaco-framework is linked outside or is compiled together in one file.

But I think Manuel did the right decision to compile it in one ... remember Jabaco is brand new and at the moment it is beta version. So in this way it can be much more simpler for Jabaco to gain more and more users - just give away one file to make your customers, friends or colleagues say "Wow". :D

No extra installation has to be done (beside Java of course)

greetings

OlimilO

JMOODY

Beginner

  • "JMOODY" started this thread

Posts: 7

Date of registration: Mar 24th 2009

  • Send private message

9

Friday, March 27th 2009, 9:34am

Hi,
That makes a lot of sense, I guess, though I don't understand it completely.

I remember some years ago me and my son Jamie were trying to use Java and a message came up on the computer saying it is deprecated software. So we didn't go with Java. Then later visual basic is deprecated in favour of the .NET framework. That messed me up a bit, both Java and Basic getting deprecated, it is really great that they are both back again.

Here is my Deactivate routine

Public Sub Form_Deactivate()
If activated=1 Then
Call MYsub()
Else
activated=1
End If

End Sub

I had to set dim activated as integer in the general declarations and activated=0 in Form_Load This is because when doing things in the way you described above, Form_Deactivate would fire twice, once when the form is loaded and once when closed by the user. The integer "activated" forbids the call of MySub when the form is loading.

Don't forget to think about whether there is any way to set an alpha for the form background.
JM

Manuel

Administrator

  • "Manuel" is male

Posts: 256

Date of registration: Jul 16th 2008

Location: Erlangen, Germany

Occupation: Software Developer

Hobbies: Jabaco, game theory, text-mining

  • Send private message

10

Monday, August 10th 2009, 9:19pm

fixed since version 1.4.2

Rate this thread
WoltLab Burning Board