Announcement

Collapse
No announcement yet.

Are Bat. files obsolete?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    BAT LIFE CONTINUESILLY!?

    Comment


    • #17
      Originally posted by St Leo
      Friends don't let friends pirate Microsoft programmes.
      Rather - Friends should warn friends about using Microsoft programmes - period.

      Having had my fill of XP I'm now thinking of upgrading to W98...

      Comment


      • #18
        Re: Are Bat. files obsolete?

        Originally posted by techumseh
        So my question is whether or not anyone is able to come up with a solution, or whether Bat. files will be rendered obsolete?
        Batch files are obsolete, but they were already obsolete several years ago:
        When Microsoft started designing Win95 it was clear that old DOS batch files were not flexible enough to work with the new OSes.
        So they developed the "Windows Script Host" as a kind of Windows Batch Files, Win98 was the first OS of the Windows family to have WSH embedded but it is also present in ME,NT and XP operating systems.
        So, in fact, the solution for post-batch era is already on your computer
        You can download latest WSH version (5.6 i think) from Microsoft at http://msdn.microsoft.com/scripting
        but if you've XP you should already have it, just download the documentation.
        To discover which WSH version you've installed open a DOS Prompt and write "cscript" it should print the WSH header containing the version number.

        I'm trying to attach (let's hope i succeed...) two versions of Boco example, one in JScript (the Microsoft version of JavaScript)
        and the other in VBScript (a macro language based on Visual Basic).
        I personally prefer JScript syntax but VBScript probably is more similar to DOS Batch files.
        To try them open a DOS prompt, move to the directory where you downloaded the scripts, and launch the interpreter writing "cscript BatsAreObsolete.js" or "cscript BatsAreObsolete.vbs".
        Unfortunately you can't simply double click on them because doing so you will launch the WScript (Windows Parser) instead of CScript (Console parser, will work in a DOS Prompt windows) but you can create a single-line BAT file (funny isn't it? ) containing the line: "cscript scriptfilename" just to launch the console parser.

        IMHO WSH is really more powerful than old DOS Batch files because, for example, you can rewrite the code of my example to work with WScript instead of CScript, showing windows and dialog boxes to the final user instead of few lines on a terminal screen, without talking about features of jscript or vbscript which are (almost...) real programming languages, and, last but not least, they can interact and use ActiveX objects and this opens endless possibilities (if someone is so crazy to start writing a couple of "ScenarioLeague's" ActiveX components...)

        Greetings,
        Angelo
        Attached Files
        "If it works, it's obsolete."
        -- Marshall McLuhan

        Comment


        • #19
          It's good to have you back, Angelo.
          Tecumseh's Village, Home of Fine Civilization Scenarios

          www.tecumseh.150m.com

          Comment


          • #20
            This I've got to check out. Thanks! Vscript is (almost) within my ability!
            El Aurens v2 Beta!

            Comment


            • #21
              Would those Jscripts be compatible with macs (as normal java scripts are)?
              No Fighting here, this is the war room!

              Comment


              • #22
                Originally posted by techumseh
                It's good to have you back, Angelo.
                And it's good to be here again techumseh

                Originally posted by Henrik
                Would those Jscripts be compatible with macs (as normal java scripts are)?
                Well, this is an interesting question.

                I'm extremely ignorant about Mac things so correct me if i'm going to write something obviously wrong:

                From personal experience JScript share the same syntax of JavaScript, maybe there are some differences but i've never stumbled on them and for our task of emulating old batch files i don't think we'll stumble on them too.

                The differences are, obviously, in the WSH side and on the objects it exposes.

                While in Windows there is a WScript object to manage all, in Mac (i'm talking about JavaScriptOSA implementation) you have a MacOS object.

                So, the language is probably the same but the objects on which it operates aren't.

                This problem could be solved in an easy way, but it remains a problem that made argue with MacOS several times in the past: Where on the hell is the Shell?
                I know that since MacOSX the Mac OS is heavily based on UNIX, so it now has a Shell but looking at the JavaScriptOSA homepage (http://www.latenightsw.com/freeware/JavaScriptOSA/) i was unable to find a command to write a line of text to a Unix Shell or to read the user answer from that shell.

                If you're able to find a way to write and read data from the shell using JavaScript then the other things can be easily solved and you'll have a way to execute directly JScript files under Mac otherwise...

                I've found this old webpage of the Mozilla project (http://www.mozilla.org/status/1999-9-17.html) which say:
                "Waldemar has also made the stand-alone JavaScript shell work as a Macintosh MPW tool."
                I've no idea what a MPW tool is, anyway the word Javascript near the word shell seems a promising starting point, you could check if current version of Mozilla for macintosh comes with a JavaScript Shell.

                Unfortunately keep in mind that probably VBScript will be the choice of the majority of designers since it resembles DOS Batch files and there's no simple way to port it to the Mac.
                "If it works, it's obsolete."
                -- Marshall McLuhan

                Comment


                • #23
                  Ugh, I hate to bother you guys but how do I follow Angelo's instructions for microsoft scripting? I'm very computer illiterate and need my hand held going thur this. I have XP but don't know where to put the dl or documentation.

                  Comment


                  • #24
                    Btw, I tried the choice.com thing and the only way it worked was when I put it into the specific scenario and then I could select a civ to play but the game crashed the moment I loaded the scenario so I'm back at step 1

                    Comment


                    • #25
                      Berzeker, from your last post I guess you did it well - can you tell what scen was it, what civ did you select?
                      Trying to rehabilitateh and contribuing again to the civ-community

                      Comment


                      • #26
                        Seeds of Greatness, babylonians. I put choice in that scenario and finally got the dos prompt to stay up instead of disappearing right away but when I went to start the scenario after choosing the babs the game would go to the title screen and crash

                        Comment


                        • #27
                          oh, civ 2 mge also. I see Tecumseh is on ToT

                          Comment


                          • #28
                            I can't clone the problem - it's working fine for me

                            At what point do the game actually crash? Do you have the same problem with the other civs?
                            Trying to rehabilitateh and contribuing again to the civ-community

                            Comment


                            • #29
                              Yes, all civs act that way. And it crashes at the title picture, the graphics screen for the game.

                              Comment


                              • #30
                                Java Scripts work on OS X, but you need to remember that Macs use *.pict, not gifs or bmps.
                                Vote Democrat
                                Support Democracy

                                Comment

                                Working...
                                X