Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIM - AS - VARIABLE TYPE likely bug
#14
(05-04-2024, 02:42 PM)bplus Wrote: i repeat again, you don't ever have to DIM a%, you can just start using it, whats more elegant than that?

i remind also A is a one symbol varaible name and A% is a two symbol variable you seem to be conflating the two different names, by your @bartok 'philosophy' you'd never use a one symbol variable name and thats fine if you like typing all those suffixes.

ps i like bringing philosophy into coding style mainly because KP doesn't ha, ha.

also i remind the hobgoblin effect of foolish consistencies.
I know that I don't have to DIM X% and that I can just start using it, but I don't like to do like that: I don't consider this elegant, because it is less tidy and therefore, less elegant: this is my "philosopy". So, I like to use OPTION _EXPLICIT, declaring all the variables and using only one way to do that: with suffixes, or with "AS". So, is it true or not, that if I DIM variables with "AS", I can't do:
DIM X AS INTEGER
DIM X AS SINGLE
?

So, considered that, as said, I want to declare all the variables only in one way, is it true or not, that I can do only:
DIM X%
DIM X!
?

because I don't want to do neither:
DIM X AS INTEGER
DIM X!
and then
X = 39 (or X% = 39)
X! = PMAP(X, 2) (or X! = PMAP(X%, 2))

nor directly, without declaration:
X% = 39
X! = PMAP(X%, 2)

So, what's the problem? I don't like to use a one symbol name. My original post was intended only to understand why I had an error with:
DIM X AS INTEGER
DIM X AS SINGLE

once understood that QB is conceived like that and therefore DIMing variables with "AS" allow, if wanted, to use in the code variables without suffixes, the question is closed for me. The rest of the things are my personal choices of coding which were not the subject of my question. I didn't ask if my code is more beautiful if I write DIM X% rather then DIM X AS INTEGER or if Aristotele would appreciate much a more a direct X%=39 without variable declaration.
Reply


Messages In This Thread
DIM - AS - VARIABLE TYPE likely bug - by bartok - 05-03-2024, 06:59 AM
RE: DIM - AS - VARIABLE TYPE likely bug - by bartok - 05-04-2024, 10:25 PM



Users browsing this thread: 2 Guest(s)