OT: Power Basic Sucks -- Big Time

How can anyone get understandable help from the error output when a Compile is invoked? It flags this line:

GLOBAL hData (26) AS BYTE ' data to send

as:

Classic PowerBASIC Console Compiler Classic PB/CC Version 4.06 Copyright (c) 1998-2010 PowerBasic Inc. Englewood, Florida USA All Rights Reserved

Error 414 in E:\Projects\POWERB~1\TekPower Load.bas(33:019): ")" expected Line 33: GLOBAL hData (26) AS BYTE ' data to send ============================== Compile failed at 7:57:49 AM on 9/11/2014

So, where is the f____ing problem?

Reply to
John S
Loading thread data ...

Is there a space between the a and the (

Reply to
Anonymous

I've tried it every which way.

Reply to
John S

On Thu, 11 Sep 2014 08:01:23 -0500, John S Gave us:

error 414 It is looking for a ")" to go with a previous "("

Reply to
DecadentLinuxUserNumeroUno

Is there a missing ) in the previous line

Reply to
Anonymous

On Thu, 11 Sep 2014 12:08:11 -0300, Anonymous Gave us:

Or maybe just add one more and see if it gets happy...

Does it compile OK under other basic compilers?

Use a Linux version. Boot a Knoppix DVD and see if it is not already installed there to use in a live session.

Reply to
DecadentLinuxUserNumeroUno

Sure that closing paren isn't actually a right brace?

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 

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

No.

Reply to
John S

On Thu, 11 Sep 2014 11:21:57 -0400, Phil Hobbs Gave us:

Yer eyes are playin' tricks on ya, optical man... :-) hehehe

Reply to
DecadentLinuxUserNumeroUno

I did. It doesn't.

I have Power Basic. I can't compile otherwise.

Linux is not in my future.

Reply to
John S

On Thu, 11 Sep 2014 10:26:17 -0500, John S Gave us:

It was a suggested test of (against) your power basic compiler. A diagnostic tool to determine if your code is bad, or if the compiler has a problem.

Reply to
DecadentLinuxUserNumeroUno

Thanks for your input, Phil. Just to be sure, I replaced it with the closing parenthesis while watching my finger do so. No joy.

Reply to
John S

On Thu, 11 Sep 2014 10:30:23 -0500, John S Gave us:

The line where that global hdata parameter gets set. Maybe it is being set to the wrong data type. Or maybe it is being put in as an alt-character, or needs to be.

Reply to
DecadentLinuxUserNumeroUno

From the PBCC HELP:

GLOBAL statement Purpose Declare global (shared) variables between Subs and Functions. Syntax GLOBAL variable[()] [ AS type] [, variable[()]] [, ...]

GLOBAL variable[()] [, variable[()]] [, ...] AS type Remarks GLOBAL declares the specified variable(s) as global to the entire program. This gives a Sub or Function access to variable(s), without having to pass them as parameters. To declare an array as a global variable, use an empty set of parentheses in the variable list:

GLOBAL MyArray%()

GLOBAL StringArray() AS STRING

You must then use the DIM or REDIM statements to dimension the array inside a Sub or Function.

--

John Larkin         Highland Technology, Inc 

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

It sounds like you've tried a bunch of stuff.

Have you tried commenting out the whole line? Or putting it earlier or later in the program?

Sometimes the point where a compiler realizes it's all fouled up is well after the actual error in the code, and you have to do some exploratory modifications to see how the compiler responds. If commenting out the offending line just makes the problem happen later, then it's not the offending line. Similarly, if moving the offending line to the beginning of the program makes it not barf on the offending line, then it's not the offending line.

If you can take that one line, put it at the beginning of a single program file with no includes, and it barfs -- then its the line.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

On Thu, 11 Sep 2014 11:30:30 -0500, Tim Wescott Gave us:

Which would make a "414" error a "syntax error"?

Did anyone look at the description for what a 414 error is? Or is that included in the barf flag line?

Reply to
DecadentLinuxUserNumeroUno

The problem is the gap between "hData" and "(26)".

If hData is a 26-element array, write "hData(26)".

HTH, James Arthur

Reply to
dagmargoodboat

On Thu, 11 Sep 2014 09:39:51 -0700 (PDT), snipped-for-privacy@yahoo.com Gave us:

That'll probably do it. He has to find where it gets declared now.

Reply to
DecadentLinuxUserNumeroUno

The problem is the "26".

The correct syntax has empty parentheses.

--

John Larkin         Highland Technology, Inc 

jlarkin att highlandtechnology dott com 
http://www.highlandtechnology.com
Reply to
John Larkin

Yes, right, that's it. The "dim" statement gives the size, the "type" statement doesn't. (It has been a while since I used FrankenBasic.)

(I like QuickBasic and variants, but the type declarations are a bit kludgy.)

Cheers, James Arthur

Reply to
dagmargoodboat

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.