Re: Object oriented
- From: "Paul Randall" <paulr901@xxxxxxxxxxxx>
- Date: Tue, 22 Jan 2008 16:39:26 -0700
"Adam" <atr@xxxxx> wrote in message
news:fn4u0r$ktu$1@xxxxxxxxxxxxxxxxxxxxxx
Hi Paul,
Thank you very much. All the information is very useful for me.
As for my programming experience - I programmed a lot years ago,
it was frist of all in Fortran and a little in C - everything under
DOS.
So I am familiar with structural programming but not with object
oriented approach.
There wasn't any Script56.chm file on my computer (Win XP Pro SP2).
I downloaded it from the Microsoft site but unfortunately I can't
use it
(only the left part of the window is displayed properly). I tried
the same
file on another computer and everything was OK. I don't have any
problems with using any other .chm files on my computer. I don't
know
what is going on.
My aim is to use scripts for computer and small network management
under Windows Script Host mainly. Of course I realise that I could
use
JScript instead of VBScript but I plan do learn VBA too, first of
all for
Word and Excel, and I think that it'll be better to "keep one path".
It is also possible that I'll learn Visual Basic in future too.
Is there any reason to test VB scripts using IE interface first and
then
to adapt them to stand-alone ones? I do not have any experience in
HTML so I doubt it'll make the task easier for me.
I bought Ed Wilson's "Microsoft Windows Scripting Self-Paced
Learning
Guide" yesterday. The CD attached to the book contains the text of
the
book as a searchable .pdf file.
Regards,
Adam
Hi, Adam
I agree with everything mayayana said.
I think you will find VBScript easier to learn than JScript. I
programmed in various flavors of Fortran starting in the mid 1970's.
In general character case doesn't matter in VBScript, just as it
didn't matter in the versions of Fortran I used. I capitalize my
VBScript for readability, but my brain sees the same variable name
regardless of the mixture of upper and lower case. JScript sees any
change in case to be a different variable name. So I find it very
difficult to read JScript created by others because my brain is not
trained to flag a change in how a word is cased to be significant.
Also, the general look and feel of VBScript is quite similar to
Fortran. Also, operators like += and ? just look strange to me, and
it is difficult to search the help file to figure out what they mean
in JScript. I think JScript is more C-like, but I never did C.
You might try viewing the help file in full screen mode, then drag the
divider between the left and right side to the left, to make the left
side smaller. Then it might look better in normal screen mode.
I think your book should help you on your way.
Microsoft's script center should keep you busy for a while:
http://www.microsoft.com/technet/scriptcenter/default.mspx
One online book you might want to look at:
http://www.microsoft.com/technet/scriptcenter/guide/default.mspx?mfr=true
You can search for MSDN downloads here:
http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=chm&DisplayLang=en
You can create applications as .HTA files quite easily. The Microsoft
Scripting Guys have created a number of 'O-Matic' tools, which are
very helpful to get you going. For HTAs, it is HTA_Helpomatic, or
something like that. It allows you to choose something you want to
put in your HTA, like 'create basic hta'. When you choose something
you may get results in one or both of two subwindows, HTML code and
Subroutine code. You can copy this into your HTA. Two lines I would
change in this HTML are:
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
I would change these to:
SINGLEINSTANCE="no"
WINDOWSTATE="normal"
because I often want to run two revisions of the same program at the
same time and I don't want my test windows to block everything out by
being maximized.
Using a plain text editor, paste in the HTML code and save it to a
file with an extension of .hta, like test01.hta. When you double
click that file, it should do something.
That basic HTA page doesn't do anything except open a blank window.
Let's say you want to add a button to do something. In helpomatic,
click button in the upper left window. This time you see something in
the HTML Code window and in the Subroutine Code window. Paste the
HTML code within the <body> ... </body> section of your test hta file.
Paste the subroutine code within the
<SCRIPT Language="VBScript"> ... </SCRIPT>
section.
Now when you run the HTA, you should see a button on the page, and
when you click the button, a message box should pop up. You have just
instantiated a button object on a page, set some of its properties,
and have created an event handler that executes when the button object
is clicked, and hopefully you have learned that there are a lot of
tools that make the learning curve fairly easy.
-Paul Randall
.
- Follow-Ups:
- Re: Object oriented
- From: mayayana
- Re: Object oriented
- From: Adam
- Re: Object oriented
- References:
- Object oriented
- From: Adam
- Re: Object oriented
- From: mr_unreliable
- Re: Object oriented
- From: Adam
- Re: Object oriented
- From: Paul Randall
- Re: Object oriented
- From: Adam
- Object oriented
- Prev by Date: Re: vbscript remote execution
- Next by Date: Re: List Registry Key and Information
- Previous by thread: Re: Object oriented
- Next by thread: Re: Object oriented
- Index(es):