You are not logged in.

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

1

Friday, March 12th 2010, 10:46pm

Hash at the beginning?

A hash is the directorysepertaor of Jabaco. For example:
Dim a as javax#swing#JFrame()

But in the Jabaco-Framework there is additional sometimes a hash at the beginning:
Dim a as #Color
But I see no difference between it without that hash:
Dim a as Color

Interestingly it is possible, too, to use primitive datatypes with hash at the beginning:
Dim a as #Long
And it works like that one without hash:
Dim a as Long

Do anybody know if there is any difference between something which with a hash begins and something which don't begin with an hash?

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

2

Saturday, March 13th 2010, 2:43pm

Ok, I now knoe the answer.

You can write the hash before every internal command and before every class.
For example a

Jabaco Source

1
2
3
4
5
6
#Public #Sub main(#ByJava args() #As #String)
   #Dim myArgs() #As #String
   myArgs = args
   ' [Your Source]
   #MsgBox "Hello"
#End #Sub


as Console program is allowed and compiles and runs like the same program without hashes.
For the compiler there is no difference between with or without hash at the beginning.

But if you write the code and you want to look for possible classes, it is a nice feature of the editor, that after an hash all possible classes are shown.

OlimilO

Intermediate

  • "OlimilO" is male

Posts: 277

Date of registration: Jan 18th 2009

Location: Germany

Occupation: software engineer

  • Send private message

3

Sunday, March 14th 2010, 7:05am

Hi,



No. The character "#" (Rautenzeichen), in Jabaco it has nothing to do with hash, simply openes a namespace and also openes the intellisense-Box. As far as I am concerned it has no other meaning in Jabaco.



do you know what a namespace is?



regards

OlimilO

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

4

Sunday, March 14th 2010, 1:51pm

The character "#" is called "hash" or "number sign" in English. See here

I guess it orginates from the telephone key.

The usefulness of # in the Jabaco IDE editor was not fully clear to me.
Thanks for the hint!
Apart from that, I consider the mixture of "#" and "." as one of the less elegant choices of Jabaco.
What was the reason the invent "#", rather than always using "." as separator?

Greetings

A1880

theuserbl

Intermediate

  • "theuserbl" started this thread

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

5

Sunday, March 14th 2010, 6:53pm

What was the reason the invent "#", rather than always using "." as separator?

BASIC = Beginner's All-purpose Symbolic Instruction Code
To have a "." as separator for different things, makes it harder for beginners to differ between classes and methods.
With '#' its easier to differ.
In
something#more#andmore
there is "andmore" then a class. And with
something#more.andmore()
is then "classpath" the class. Easier to read for beginners, who looks not so hard at "()".

As Java-developer you would also differ it case-sensitive as
someThing.more.AndMore
and
someThing.More.andMore()
so that Classes begins with a uppercase letter and path-names and methods beginning with a lowercase letter. But say something like that a very early beginner (who writes its fist class and methods), who is happy, that its first code works.


Greatings
theuserbl

Rate this thread
WoltLab Burning Board