Article View: comp.os.msdos.programmer
Article #3462Re: A QBASIC Question
From: gordon hlavenka
Date: Thu, 01 Oct 1992 16:03
Date: Thu, 01 Oct 1992 16:03
31 lines
1380 bytes
1380 bytes
In article <1992Sep30.105036.646@hls.com> tima@hls.com writes: >I get a syntax error. Any suggestions ???? > > DEFINT a-z > > CONST Num = 10 > > READ a <===== error is reported at this line > > DATA Num > > END You can't use a variable in a DATA statement; that's not what DATA statements are _for_. (!) If you just change the DATA statement from 'DATA Num' to 'DATA 10' it will work. (a will be set to integer 10.) Or, you could change the READ statement to 'READ a$'. But then a$ would be set to the string "Num", which is probably not what you're after. Yes, a DATA statement contains a list of constants. But it has to be (semantic wrangling happening here...) constants and not "CONSTants", as in the keyword. Those CONSTants are actually a special kind of unchangeable variable. -- ---------------------------------------------------- Gordon S. Hlavenka cgordon@vpnet.chi.il.us Don't forget: Dave Barry/Joe Walsh in November!
Technical Details
Message-ID:
<1992Oct01.160315.16057@vpnet.chi.il.us>Path:
arc1-ca.pugleaf.net!sparky!uunet!newsserver.pixel.kodak.com!laidbak!tellab5!vpnet!cgordonReferences:
<1992Sep30.105036.646@hls.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!newsserver.pixel.kodak.com!laidbak!tellab5!vpnet!cgordon From: cgordon@vpnet.chi.il.us (gordon hlavenka) Subject: Re: A QBASIC Question Message-ID: <1992Oct01.160315.16057@vpnet.chi.il.us> Organization: Vpnet Public Access References: <1992Sep30.105036.646@hls.com> Date: Thu, 01 Oct 1992 16:03:15 GMT Lines: 31