Posted: Sun Apr 18, 2010 8:12 am Post subject: Sys.Exec problems
What is it you are trying to achieve?
I am trying to create an autorun type program.
What is the problem you are having?
Sys.Exec commands runs the error: "Expression is not a procedure and hence cannot be called."
I also want to know if I am using the getch function properly.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
put"Welcome to the Geo Website Developer!" put"To run the website manually, run Main Page.html" put"If the website is not compatable with your browser, use one of the pre-installed browsers in the Alternative Browsers folder." put"To start the website now, press enter." getch(inputwait)
var winID :int
winID :=Window.Open("position:center;center")
var font1 :int
font1 :=Font.New("calibri:16:bold") Font.Draw("Copyright 2010",0, 5, font1, blue)
var inputwait :string(1)
put"Welcome to the Geo Website Developer!" put"To run the website manually, run Main Page.html" put"If the website is not compatable with your browser, use one of the pre-installed browsers in the Alternative Browsers folder." put"To start the website now, press enter." getch(inputwait)
put" " ifSys.Exec(("\"Main Page.html\""))=truethen put"Executing now..." delay(1000) Window.Close(winID) else put"Uh oh: ",Error.LastMsg, " You may have to run the file manually." endif
I plan to use this as the autorun program in a CD which I have to give for my geo project.
The reason I didn't just use notepad was that I wanted a readme type of file that also executed the program...
I guess a batch file could also have worked...will post that if I make it.
But I guess Turing's run window looks better...
ProgrammingFun
Posted: Sun Apr 18, 2010 3:12 pm Post subject: CMD Program
I created a batch file for the program above but decided that it looked ugly, was more disorganised, and was hard to run.
However, here is the file (paste in notepad and save as a bat file):
[syntax]
echo Welcome to the GEO website developer!
echo To run the website manually, run Main Page.html
echo If the website is not compatible with your computer, use one of the preinstalled browsers in the Alternative Browsers window.
echo To start the website now, press enter.
PAUSE
start Main Page.html
TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL
exit
[/syntax]
I now have a new problem...at the beginning, my Main Page.html file was in the same directory as the Turing program but I now moved it into a subfolder with the name of "Geography Project". How would I create a Sys.Exec path to that file instead of the one given before?
Two more questions...how do you change the run window title when the program has been compiled as an EXE?
And...how can you change the icon of the standalone program?