FAQ  •  Register  •  Login

DEFAULT Type

<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Tue Sep 04, 2012 6:55 am

DEFAULT Type

How about a addition?
Usually the variable type is allways float by default, and you can change the type of variables using DIM variable AS Type. Would it be possible to change the default type from float to different type (except String), using DEFAULT directive. E.g. DEFAULT UINTEGER will change the type of all uninitialised variables from Float to Uinteger.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Sep 04, 2012 7:08 am

Re: DEFAULT Type

Hmm. I see.
But instead of the classical DEFAULT a-z or the like, just declare someting like:
  Code:
DEFAULT As Integer
' Or
DIM DEFAULT As Integer
' OR
DIM As Integer By Default
Or something like that? Anyway, I think it's a good idea (I created the compiler with a default type in mind, and can be easily set up ;))
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Tue Sep 04, 2012 8:22 am

Re: DEFAULT Type

boriel wrote:Hmm. I see.
But instead of the classical DEFAULT a-z or the like, just declare someting like:
  Code:
DEFAULT As Integer
' Or
DIM DEFAULT As Integer
' OR
DIM As Integer By Default
Or something like that? Anyway, I think it's a good idea (I created the compiler with a default type in mind, and can be easily set up ;))

Excellent!
I think, the best would be
  Code:
DEFAULT As Integer
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Tue Sep 04, 2012 9:03 am

Re: DEFAULT Type

Default what?

:-)

I think logically it has to say DIM in it - something like DEFAULT DIM uinteger or DIM DEFAULT uinteger

Otherwise, it might be unclear what you are defaulting? (Okay, when we know the language, it's obvious - but it's just a thought that "default as uinteger" doesn't actually say, which feels like poor logic)
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue Sep 04, 2012 9:06 am

Re: DEFAULT Type

britlion wrote:Default what?

:-)

I think logically it has to say DIM in it - something like DEFAULT DIM uinteger or DIM DEFAULT uinteger

Otherwise, it might be unclear what you are defaulting? (Okay, when we know the language, it's obvious - but it's just a thought that "default as uinteger" doesn't actually say, which feels like poor logic)

This is why I proposed
  Code:
DIM As Uinteger By DEFAULT
<<

britlion

Posts: 766

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Tue Sep 04, 2012 9:07 am

Re: DEFAULT Type

Yes - I was pretty much supporting you, there, Boriel :-)
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Tue Sep 04, 2012 9:57 am

Re: DEFAULT Type

Then you could also make
  Code:
DIM AS Uinteger

with no variable name...
or as boriel said,
  Code:
DIM DEFAULT AS Uinteger

DEFAULT will be a reserved word anyway.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!

Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO