473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Interactive mode not very useful

Sal
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?
Jun 2 '08 #1
3 1779
On May 30, 6:14 pm, Sal <h...@softcom.netwrote:
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?
No - that's not how PHP works. Indeed, apart from a very old version
of Forth, it's not how any programming language I've ever used works.
Try editing the file first then running it.

C.
Jun 2 '08 #2
Sal wrote:
I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?
Not really. But then if you have a syntax error, your code can't be
executed anyway, so why stay in the interpreter? It would be nice if it
let you correct the error, but it doesn't. That's why I seldom use the
interpreter in interactive mode, and even then only for programs of a
few lines.

In Windows, once you've reentered the interpreter, you can use the
up/down arrow keys to scroll through the keyboard buffer. When you're
in the interpreter you'll have the lines previously entered in the
buffer. A bit awkward, but it does help a little.

Otherwise, I just use an editor to create a file and leave the editor
window open while I test the script.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 2 '08 #3
C. (http://symcbean.blogspot.com/) wrote:
On May 30, 6:14 pm, Sal <h...@softcom.netwrote:
>I'm running PHP 5.2.6 on WindowsXP. When I try interactive mode with
">php -a" the slightest syntax error throws me out of the interpreter
and back to the command line. This is not very useful. Isn't there a
way to stay in interactive mode after a syntax error?

No - that's not how PHP works. Indeed, apart from a very old version
of Forth, it's not how any programming language I've ever used works.
Try editing the file first then running it.

C.
I dunno. BASIC used to be like that.
Jun 2 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Christoph Becker-Freyseng | last post by:
Hello, is there a way to dump (and save) the command-history of the python interactive mode. Thanks, Christoph Becker-Freyseng
0
by: Steve Menard | last post by:
I have a strange problem with Python command-line interactive mode. Problem has been observed on every 2.3 version where it was tested, from 2.3 alpha to 2.3.4 Test is run on windows XP and 2000...
6
by: Avi Berkovich | last post by:
Hello, I was unable to use popen2.popen4 to grab python.exe's (2.3) output, for starts, it doesn't show the version information at the beginning and won't return anything when writing to the...
20
by: Joe | last post by:
When you run "python -i scriptname.py" after the script completes you left at the interactive command prompt. Is there a way to have this occur from a running program? In other words can I...
2
by: Charles Krug | last post by:
List: I'm trying to us pylab to see what I'm doing with some DSP algorithms, in case my posts about convolution and ffts weren't giving it away. I've been using pylab's plot function, but I'm...
3
by: DGG | last post by:
I have got a question arsing from my perl program. Basically, I want to get the machine date and time, and display it on a Tk label. I am using ActivePerl, and running on DOS/Windows. So I...
1
by: Alex | last post by:
Loking at Rossum's tutorial I've seen that he sometimes uses the expression "interactive mode" and sometimes "calculator mode". Or these concepts same? I've made the following assertion. ...
4
by: tnoell | last post by:
Hi comp.lang.python: New to the group and new to python, so don't tear me up too much ... I installed the GNU readline support in python2.4, and it is working, but there is one annoying behaviour...
4
by: digitnctu | last post by:
Dear all: I am coming with problem, to apply ctypes under interactive mode in python. libdll.dll is a third-party library. The below code segment will run well under the batch mode(ie. python...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.