ouestque
asked on
Access VB spacing code Easy!!
I have tabbed all of my code further to the right, now my boss wants me to move it back to the left.
Even though I know that this does not affect the functinoality of the code whatsoever, I must fulfill her requerst. The code is many pages long all tabbed to the right.
How do I tab all the code back to the left? Is there a way to make all code start from the begining?
Example:
Current Code: (Notice how it is spaced to the right)
rst1.Edit
rst1![vendor1] = rst![quote_date]
rst1.Update
rst1.MoveNext
How my boss wants it: (She wants it all at the begining of each row like below)
rst1.Edit
rst1![vendor1] = rst![quote_date]
rst1.Update
rst1.MoveNext
Even though I know that this does not affect the functinoality of the code whatsoever, I must fulfill her requerst. The code is many pages long all tabbed to the right.
How do I tab all the code back to the left? Is there a way to make all code start from the begining?
Example:
Current Code: (Notice how it is spaced to the right)
rst1.Edit
rst1![vendor1] = rst![quote_date]
rst1.Update
rst1.MoveNext
How my boss wants it: (She wants it all at the begining of each row like below)
rst1.Edit
rst1![vendor1] = rst![quote_date]
rst1.Update
rst1.MoveNext
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
{Sorry for the duplicate post... I *thought* I had refreshed the window before posting}
>How my boss wants it: (She wants it all at the begining of each row like below)
Just out of curiosity, is your boss a programmer?
Are you a programmer?
Our answer will vary widely based on your response.
Just out of curiosity, is your boss a programmer?
Are you a programmer?
Our answer will vary widely based on your response.
ASKER
Yes we are both programmers, but there is usually a reason why she wants such things done.
In that case, some possibilities are:
(1) She wants your programming to match their well-established coding convensions, so later in life they can look at your code an not have to go through any special hoops to understand it.
(2) She views you as an amateur programmer, and is attempting to train you in her definition of the 'right' way to program. Since you're even asking this question, the likelihood here is pretty good.
>Even though I know that this does not affect the functinoality of the code whatsoever, I must fulfill her requerst.
Correct. It has nothing to do with functionality, and everything to do with readability.
She doesn't want to read your code six months ago and have the first thought be 'Who wrote this pile of cr&p?'
Highlight all code, then hit tab key to indent to the right. Shift-tab indents back to the left.
VERY common coding practices are to indent everything within a decision structure such as If..Then, For..Next, Do..While, etc.
(1) She wants your programming to match their well-established coding convensions, so later in life they can look at your code an not have to go through any special hoops to understand it.
(2) She views you as an amateur programmer, and is attempting to train you in her definition of the 'right' way to program. Since you're even asking this question, the likelihood here is pretty good.
>Even though I know that this does not affect the functinoality of the code whatsoever, I must fulfill her requerst.
Correct. It has nothing to do with functionality, and everything to do with readability.
She doesn't want to read your code six months ago and have the first thought be 'Who wrote this pile of cr&p?'
Highlight all code, then hit tab key to indent to the right. Shift-tab indents back to the left.
VERY common coding practices are to indent everything within a decision structure such as If..Then, For..Next, Do..While, etc.
>VERY common coding practices are to indent everything within a decision structure such as If..Then, For..Next, Do..While, etc.
If you have any doubts here, go to a sub that has six nexted decision structures, then remove all indentations by highlighting all, then shift-tabbing back to the left. You'll immediately see what I mean.
If you have any doubts here, go to a sub that has six nexted decision structures, then remove all indentations by highlighting all, then shift-tabbing back to the left. You'll immediately see what I mean.
To emphasise what Jim is saying, you can buy/download code manager programs which go through code and insert suitable indents for all control structures. Aligning everything to the left would be regarded by everybody as poor practice, I think.
EDIT -> Outdent
That said, yuck! The formatting makes the code so much more readable!