Whats Wrong? 
Author Message
 Whats Wrong?

Please see attached.

[ TESTPGM.TXT < 1K ]
'I have the shareware version of powerbasic, and I am trying to
'evaluate it using the instructions included.
'The following program will run as is using Qbasic with DOS 6.2
' When I compile it with PowerBasic, I get the 477 syntax error
' noted below and I can not get past it.
' Can you help me?  I thought that PowerBasic was compatible w/Qbasic.
'---------------------------------------------------------------------
CLS
OPEN "LIST" FOR OUTPUT AS #1
DO
    INPUT "Enter Name", Name$   <--- ERROR 477 SYNTAX ERROR
    INPUT "Age", Age$
    WRITE #1, Name$, Age$
    INPUT "Add another entry"; r$
LOOP WHILE UCASE$(r$) = "Y"
CLOSE #1
'Echo the file back.
OPEN "LIST" FOR INPUT AS #1
CLS
PRINT "Entries in file:": PRINT
DO WHILE NOT EOF(1)
    LINE INPUT #1, REC$  'Read entries from file.
    PRINT REC$           'Print the entries on the screen.
LOOP
CLOSE #1



Mon, 05 Jul 1999 03:00:00 GMT  
 Whats Wrong?

Quote:
>'I have the shareware version of PowerBasic, and I am trying to
>'evaluate it using the instructions included.
>'The following program will run as is using Qbasic with DOS 6.2
>' When I compile it with PowerBasic, I get the 477 syntax error
>' noted below and I can not get past it.
>' Can you help me?  I thought that PowerBasic was compatible w/Qbasic.

You have been mislead.  PowerBasic and FirstBasic are somewhat QBasic
compatible, but there are differences.

I think I know what your problem is.  I believe Name is a reserved word in
PB/FB.  In QBasic, it didn't catch this, because the actual statement is NAME
(which renames a file), not NAME$.  However, PB/FB may not allow use of any
reserved words, no matter what variable type (string, integer, etc.) you're
using.  

Try changing Name$ to YourName$ or something similar and see what happens.

Hope this helps.

-Jesse

====================================
Very funny Scotty!
Now beam down my clothes!
====================================



Mon, 05 Jul 1999 03:00:00 GMT  
 Whats Wrong?

Quote:
>Date: Thu, 16 Jan 97 16:55:46 -0800

>Newsgroups: comp.lang.basic.misc
>Subject: [News] Whats Wrong?

Hi,Lloyd!

Quote:
>' Can you help me?  I thought that PowerBasic was compatible w/Qbasic.
>'---------------------------------------------------------------------
>CLS
>OPEN "LIST" FOR OUTPUT AS #1
>DO
>    INPUT "Enter Name", Name$   <--- ERROR 477 SYNTAX ERROR

                         ^^^^
                         It's reserved word, so you have
                         to do global search and replace,
                         say "Name" to "Zname"...

That's all, my friend!

    Good luck,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Tue, 06 Jul 1999 03:00:00 GMT  
 Whats Wrong?

: 'I have the shareware version of PowerBasic, and I am trying to
: 'evaluate it using the instructions included.
: 'The following program will run as is using Qbasic with DOS 6.2
: ' When I compile it with PowerBasic, I get the 477 syntax error
: ' noted below and I can not get past it.
: ' Can you help me?  I thought that PowerBasic was compatible w/Qbasic.

:     INPUT "Enter Name", Name$   <--- ERROR 477 SYNTAX ERROR

Try:

    INPUT "Enter Name"; aVar$

It may be {*filter*} on the comma, or it may be {*filter*} on the use of Name
as a variable name (name is a reserved word).

Carl
--
------------------------------------------------------------------

 author of Liberty BASIC, a 1996 PC Magazine Awards Finalist!
  http://www.*-*-*.com/ ~carlg/basic.html



Tue, 06 Jul 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. WHATS WRONG with this outlook!!please HELP!!!

2. Whats wrong with SQL statement for OpenForm

3. Whats wrong with withis code???

4. Whats Wrong with this CODE!

5. Whats wrong here?

6. Whats wrong

7. Can anyone tell me whats wrong with this?

8. Whats wrong with this short sourcecode

9. Whats wrong

10. whats wrong with this code?

11. whats wrong with that

12. Whats wrong with this line of code?

 

 
Powered by phpBB® Forum Software