Re: Passing parameters from page to page in HTA app

From: Trent (notvalid_at_dontspam.com)
Date: 12/03/04


Date: Fri, 3 Dec 2004 08:57:52 -0500

Have not yet worked with xml.
I have considered using includes and may switch to it eventually but at this
moment I am in a time crunch and that would require a good deal of
alteration to my existing code. I use includes a lot in my ASP code.

I almost have the application worked out, just doing the finishing touches.
The next step is taking the data and creating formatted output probably in a
.doc file so they can print it. This is the part I suspect may give me the
most trouble. If all goes well then I will build additional controls so
that from the application they can alter page margins, font sizes and
styles, etc.

"benben" <benhongh@yahoo.com.au> wrote in message
news:#SgUwVS2EHA.1564@TK2MSFTNGP09.phx.gbl...
> Well, it is so true of what you said. Indeed. But let's just review the
> include file option. You can actually write a master page which is only
for
> page switching. Within the master page implement a javascript interface (a
> set of functions, or objects if you'd like to go oop), so that child pages
> can make calls to this interface for a page switch.
>
> Then child pages then, are loaded by the master page into <div>'s. You can
> use file system object or msxml to implement. Easy huh?! Again, all the
page
> loading / swtiching are done by the master page, and so to keep the child
> pages very clean.
>
> Now your coworkers only have to understand the child pages, plus the
> page-switching interface defined in the master page. It is for their
> advantage not to examine the master page anyway.
>
> An alternative is to define pages (both child pages and the master page)
in
> xml format. Then you will write an XSL Transform to work out the rest.
Lot's
> of fun.
>
> ben
>
> > Yeah, I am already using div within the pages I have created and
> > hiding/showing different options as I go.
> > But the amount of code for each page I am writing is getting long and
> > combining the pages all in one would make it difficult for a coworker to
> > pick up an easily understand. I thought if I kept it modular it would
be
> > easier for them to support or modify as needed.
> >
> > I have also considered using includes to pull in the modular pieces into
> one
> > working file but again, it get's confusing for troubleshooting later on.
> >
> > I just tried using parent.location to change pages but it actually
> launches
> > another window when used within an hta.
> >
> > I think you are right and that putting it all in one file is the better
> way
> > to go to make an efficient application but my coworkers keep hitting me
> over
> > the head saying "I can't understand your code, how can I support it?" I
> > have had to work HARD to try and soften up my code a bit and end up with
> > lots if statments where I could have setup a nested loop and done it in
10
> > lines rather than 40. Things like that. :)
> >
> > "benben" <benhongh@yahoo.com.au> wrote in message
> > news:#aXgSHI2EHA.2572@tk2msftngp13.phx.gbl...
> > > If all you have to do is to break the application into a number of
pages
> > and
> > > to switch between pages, you can use <div>'s to "contain" the pages
> inside
> > > the HTML body. Set the display property to hidden all <div>'s except
the
> > one
> > > you want to show. You will save all the hassel of parameter passing
and
> > page
> > > loading and it is fast.
> > >
> > > benben
> > >
> > > > Never mind, I managed to get the value to set. Just a matter of
> > figuring
> > > > out the correct syntax for the commands.
> > > > Mixing of VBScript, JavaScript and WScript is confusing the hell out
> of
> > > me.
> > > > :)
> > > >
> > > > What is the best method of switching pages for the app?
> > > > I am building this in sections and will then pass the few values I
> need
> > > > through the environment variables as you showed me but how should I
> > switch
> > > > from one page to the next? Using the HTML form action and just
> calling
> > > the
> > > > next page? Or should I close/open windows, or is there a way to
> reload
> > a
> > > > new HTA in the same window that I do not know yet?
> > > >
> > > > They moved my deadline. Rather than having it complete on Dec 15
they
> > > want
> > > > something they can begin testing with tomorrow. It does not have to
> be
> > > > perfect but my approach has to change since I was building
individual
> > > > components and had not tied them together yet (or completed all the
> > > > components) so now I have to scramble to get a basic menu system
> > working.
> > > >
> > > > Thanks very much for your help. So little info is out there on HTA
> and
> > my
> > > > company closed their library. I have access to an online library
but
> > have
> > > > not checked it out yet to see if it might have any books applicable
to
> > my
> > > > current application.
> > > >
> > > > "McKirahan" <News@McKirahan.com> wrote in message
> > > > news:mwqrd.700314$8_6.362928@attbi_s04...
> > > > > "Trent" <notvalid@dontspam.com> wrote in message
> > > > > news:uzVkxy91EHA.936@TK2MSFTNGP12.phx.gbl...
> > > > > > Leaving the key would not necessarily be a problem as long as I
> > alter
> > > > the
> > > > > > value so on next run it does not have one in there until I set
it.
> > > > > > Is there an easy method of removing the key at the end as a
> cleanup
> > > > > process?
> > > > > > If I always use the same key name it does not really matter but
I
> > like
> > > > to
> > > > > > code clean as possible and not leave stuff behind that does not
> need
> > > to
> > > > be
> > > > > > there. :)
> > > > > >
> > > > > > Thanks.
> > > > >
> > > > > [snip]
> > > > >
> > > > > This should do it: look at "delENV(ENV)".
> > > > >
> > > > > <html>
> > > > > <head>
> > > > > <title>ENV.hta</title>
> > > > > <script type="text/vbscript">
> > > > > Option Explicit
> > > > > '*
> > > > > '* Declare Constants
> > > > > '*
> > > > > Const cHTA = "ENV.hta"
> > > > > '*
> > > > > '* Set Parameter
> > > > > '*
> > > > > document.write cHTA
> > > > > document.write "<br><br> setENV('Hello=World')"
> > > > > Call setENV("Hello=World")
> > > > > '*
> > > > > '* Get Parameter
> > > > > '*
> > > > > document.write "<br><br> getENV('Hello')"
> > > > > document.write "<br><br> Hello = " & getENV("Hello")
> > > > > '*
> > > > > '* Del Parameter
> > > > > '*
> > > > > document.write "<br><br> delENV('Hello')"
> > > > > Call delENV("Hello")
> > > > >
> > > > > Sub delENV(ENV)
> > > > > '*
> > > > > '* Get Environment Variable
> > > > > '*
> > > > > Dim objWSS
> > > > > Set objWSS = CreateObject("WScript.Shell")
> > > > > Dim objENV
> > > > > Set objENV = objWSS.Environment("Volatile")
> > > > > objENV(ENV) = ""
> > > > > Set objENV = Nothing
> > > > > objWSS.RegDelete "HKCU\Volatile Environment\" & ENV
> > > > > Set objWSS = Nothing
> > > > > End Sub
> > > > >
> > > > > Function getENV(ENV)
> > > > > '*
> > > > > '* Get Environment Variable
> > > > > '*
> > > > > Dim objWSS
> > > > > Set objWSS = CreateObject("WScript.Shell")
> > > > > Dim objENV
> > > > > Set objENV = objWSS.Environment("Volatile")
> > > > > getENV = objENV(ENV)
> > > > > Set objENV = Nothing
> > > > > Set objWSS = Nothing
> > > > > End Function
> > > > >
> > > > > Sub setENV(ENV)
> > > > > '*
> > > > > '* Set Environment Variable
> > > > > '*
> > > > > If InStr(ENV,"=") = 0 Then Exit Sub
> > > > > Dim arrENV
> > > > > arrENV = Split(ENV,"=")
> > > > > Dim objWSS
> > > > > Set objWSS = CreateObject("WScript.Shell")
> > > > > Dim objENV
> > > > > Set objENV = objWSS.Environment("Volatile")
> > > > > objENV(arrENV(0)) = arrENV(1)
> > > > > Set objENV = Nothing
> > > > > Set objWSS = Nothing
> > > > > End Sub
> > > > > </script>
> > > > > </head>
> > > > > <body>
> > > > > </body>
> > > > > </html>
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Passing parameters from page to page in HTA app
    ... Within the master page implement a javascript interface ... >> set of functions, or objects if you'd like to go oop), so that child ... >> can make calls to this interface for a page switch. ... >> use file system object or msxml to implement. ...
    (microsoft.public.scripting.jscript)
  • Re: Company Sued Over Washing Machine Death
    ... Doesn't mean we can actually *open* the oven door until ... but there should be a cut off switch for emergencies. ... > Of course the child shouldn't have climbed into the washing machine, ... > brother shouldn't have slammed the door shut, but kids do stupid things all ...
    (alt.true-crime)
  • Re: Company Sued Over Washing Machine Death
    ... but there should be a cut off switch for emergencies. ... >> brother shouldn't have slammed the door shut, but kids do stupid things ... > to open, the child might still have died, depending on how much water ... > door open, and push the coin slide in. ...
    (alt.true-crime)
  • Re: Company Sued Over Washing Machine Death
    ... but there should be a cut off switch for emergencies. ... >>> brother shouldn't have slammed the door shut, but kids do stupid things ... >> to open, the child might still have died, depending on how much water ... >> door open, and push the coin slide in. ...
    (alt.true-crime)
  • Re: Multi-body or Assembly?
    ... components are so intimately intertwined that in-context is a terribly ... I want to keep the rebuild time of the master model as short as ... model don't transfer to the child parts - dims in the child parts ... It was odd to hear you say that the SWx establishment is opposed to ...
    (comp.cad.solidworks)

Loading