![]() |
|
DEFAULT Type - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Wishlist (https://forum.boriel.com/forumdisplay.php?fid=14) +---- Thread: DEFAULT Type (/showthread.php?tid=495) |
DEFAULT Type - LCD - 2012-09-04 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. Re: DEFAULT Type - boriel - 2012-09-04 Hmm. I see. But instead of the classical DEFAULT a-z or the like, just declare someting like: Code: DEFAULT As Integer )
Re: DEFAULT Type - LCD - 2012-09-04 boriel Wrote:Hmm. I see.Excellent! I think, the best would be Code: DEFAULT As IntegerRe: DEFAULT Type - britlion - 2012-09-04 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) Re: DEFAULT Type - boriel - 2012-09-04 britlion Wrote:Default what?This is why I proposed Code: DIM As Uinteger By DEFAULTRe: DEFAULT Type - britlion - 2012-09-04 Yes - I was pretty much supporting you, there, Boriel :-) Re: DEFAULT Type - LCD - 2012-09-04 Then you could also make Code: DIM AS Uintegeror as boriel said, Code: DIM DEFAULT AS Uinteger |