Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

anguage of style

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
GB
Hi All :)
I have just finished writing my first serious vbscript in about....god, 5 years.
I am stuck between:


[Option1]
intGReturn = 1
Call Task A
If Result from Task A is Good
Call Task B
If Result from Task B is Good
Call Task C
...and so on, we all all good
If Result for Task n is Good
intGReturn = 0

...
Wscript.Quit intGReturn

[Option2]
Call Task A (Sub/Function of Task A was a Wscript.Quit 1 given failure)
Call Task B (Sub/Function of Task B was a Wscript.Quit 1 given failure)
Call Task C (Sub/Function of Task C was a Wscript.Quit 1 given failure)
Wscript.Quit 0

I have spent 20 years moving totally towards a Task driven approach to manipulating computer systems, top down Task Sequencing...
I thought I was doing the right thing, it had dawned on me I have just moved to 'Option 2' which my early teaching led me to believe was bad form,,,from a coding perspective.

I am back in the game, but fear I need to spend most of my time in the Powershell forum as vbscript is dead?

Cheers all tek-tips members,,,still the best forum site if you ask me.


I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
...i think the pattern is to just avoid the nesting, also avoid the Wscript.Quits in each Function, then i dont offend delicate sensibilities

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top