QBasic syntax error?

Comments are the problem. I went through a bunch of trouble to set up a VM with a 32-bit Virtual XP and then copy all my QBASIC stuff over from an older machine to try it out after posting my response.

It was pretty easy to test. I didn't use just your code. I used some I wrote, too, just to be absolutely sure.

No comments on DATA statements in QBASIC. The documentation even mentions it: "A remark can be inserted on a line after an executable statement if it is preceded by the single-quote form of REM or if REM is preceded by a colon." Note the use of "executable statement" in the above description. DATA is not an executable statement.

Besides. I tried a lot of different ways to check this out. You can't do it. Check it out yourself. It will actually read up the comment, if you try using a string variable instead of a numeric one. It is NOT a comment on a DATA statement. It is part of the data, like it or not.

Jon

Reply to
Jon Kirwan
Loading thread data ...

Robbie the Robot was from "Forbidden Planet", which was a classic sci-fi version of Shakespeare's "The Tempest". Robbie appeared in numerous other movie and TV productions over the years. (Regarding "The Tempest" / "Forbidden Planet", Michael Crichton also "borrowed" the same basic "creatures from the id" theme for "Sphere".)

Best regards,

Bob Masta DAQARTA v7.10 Data AcQuisition And Real-Time Analysis

formatting link
Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE Signal Generator, DaqMusic generator Science with your sound card!

Reply to
Bob Masta

--
Larkin, more than likely.
Reply to
John Fields

One of my guys wrote a C program (GCC, linux) that involved some signal averaging. One subroutine added 4 million 16-bit ADC samples to a 32-bit array. It seemed awfully slow to me, so I did it on my PC in PowerBasic, just a FOR loop with the obvious subscripts, no pointers or anything, 8 lines of code or some such. It took a minute or two to code and compile. Mine was 4x faster than his. After a day of futzing with compiler optimizations and stuff, he got his runtime down to 1.2x of mine.

What's cool about an ugly, hazardous, 40 year old programming language? What's good about syntax errors?

--

John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom timing and laser controllers 
Photonics and fiberoptic TTL data links 
VME  analog, thermocouple, LVDT, synchro, tachometer 
Multichannel arbitrary waveform generators
Reply to
John Larkin

---------------------------------------------------------------------------­­-------------

-

Was the $50 thing the DOS version? It's OK, but the 32-bit Console Compiler rocks. It does Ethernet / TCP/IP beautifully. Good Windows graphics.

--

John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom timing and laser controllers 
Photonics and fiberoptic TTL data links 
VME  analog, thermocouple, LVDT, synchro, tachometer 
Multichannel arbitrary waveform generators
Reply to
John Larkin

---------------------------------------------------------------------------­-------------

Okay, I checked, the one in Lost In Space was "Robby", not "Robbie". Being Canadian, obviously my ear for American accents missed the distinction. ;)

I have no big issue with BASIC--old FORTRAN code has the same problem.

But Merry Christmas to you and your family as well.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 USA 
+1 845 480 2058 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

---------------------------------------------------------------------------­-------------

If you think that's gorgeous, you need to get out more.

;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 USA 
+1 845 480 2058 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

Cool, I'll give it a try.

George H.

Reply to
George Herold

th

Oops, my fault I was thinking of Robbie

formatting link

George H.

Reply to
George Herold

------­­-------------

tax

hen

iables

n with

Wow.. OK, apparently I screwed up too. All I can say is that Asimov's Robbie (sans Robot) dates to 1939.

I never knew there were so many...

Oh it's just the 'hammer' I'm comfortable with.

Thanks, we had a great time at granma's, another family with twin boys always joins us. They're six now, nothing like a pair of six year old boys to spice up the evening! I parked myself in a corner with a beer and enjoyed the show.

George H.

t -

Wow.. OK, apparently I screwed up too. All I can say is that Asimov's Robbie (sans Robot) dates to 1939.

Reply to
George Herold

with

e_(short_story)

double oops, I missed a )

formatting link

Reply to
George Herold

array.

than

there's no shortage of bad programmers.

So you think an older programming language is better?

--
?? 100% natural 

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Reply to
Jasen Betts

If you want, you can just start up the DOS box, then type:

MODE CON: LINES=50

Then start up QB45.

Jon

Reply to
Jon Kirwan

t

Ok Jon, I added a colon at the end of the DATA statement followed by the comment, and the problem went away. Still strange why Borland Turbo Basic behaves differently. Jasen also had the right answer.

-Bill

Reply to
Bill Bowden

Why is it strange? They were written by different people.

Reply to
Michael A. Terrell

Why strange? There is no standard BASIC, or I guess it's really "there's so many to choose from".

Reply to
krw

array.

than

He wrote the obvious c code, a loop with pointers and an add.

What's

PowerBasic isn't old.

Modern Basics have all sorts of goodies. Like TRY/CATCH, PRINT USING, jillions of cool intrinsic string functions, all sorts of data types, great graphics built in. Basic has evolved a lot, and c has hardly evolved at all.

The best programming language around is probably Ada, but few people are willing to invest the modest amount of discipline that it requires. Most people prefer to type fast and debug until they have to ship.

--

John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom timing and laser controllers 
Photonics and fiberoptic TTL data links 
VME  analog, thermocouple, LVDT, synchro, tachometer 
Multichannel arbitrary waveform generators
Reply to
John Larkin

array.

or

than

his

What's

willing

Why stop then? Certainly bugs don't care that the product was shipped. IME, they rather like a new set of hands to uncover them.

Reply to
krw

--
Hmm... 

Dr Phil wants to play, eh?
Reply to
John Fields

array.

FOR

or

than

his

What's

willing

Sure, let the users find the bugs for you. Microsoft does that. Next rev, fix a few of the worst ones and add a bunch more. Step and repeat.

formatting link

I love those examples on page 2.

--

John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom timing and laser controllers 
Photonics and fiberoptic TTL data links 
VME  analog, thermocouple, LVDT, synchro, tachometer 
Multichannel arbitrary waveform generators
Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.