Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

need help debugging old school BASIC program

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  Two Cocoa Errors I can't figure out..  
Author Message
Marco3

External


Since: Jun 24, 2004
Posts: 1



(Msg. 1) Posted: Thu Jun 24, 2004 10:13 pm
Post subject: need help debugging old school BASIC program
Archived from groups: comp>sys>mac>programmer>help (more info?)

this basic program (simple poetry-generating program) keeps giving me
errors. I'm using the free Chipmunk Basic on OSX. Any help apprectiated..

10 rem hanshan
20 gosub 250 : rem initialize
30 rem choose pattern
40 r = int(rnd(1)*3)+1
50 on r gosub 90,140,190
60 for t = 1 to 2500 : next t
70 print : print : print
80 goto 40
90 rem ** pattern one **
100 color 14 : print w$(int(rnd(1)*20+1));"...";w$(int(rnd(1)*20+1))
110 print tab (5);"...";w$(int(rnd(1)*20+1))
120 print tab (8);s$(int(rnd(1)*20+1))
130 return
140 rem ** pattern two **
150 color 10 : print s$(rnd(1)*20+1))
160 print tab (3);s$(int(rnd(1)*20+1));"..."
170 print tab (6);s$(int(rnd(1)*20+1))
180 return
190 rem ** pattern three **
200 color 15 : print tab (3);w$(int(rnd(1)*20+1))
210 print s$(int(rnd(1)*20+1))
220 print tab (3);w$(int(rnd(1)*20+1));",";s$(int(rnd(1)*20+1))
230 return
240 rem ****************
250 rem initialization
260 width 40
270 randomize val(right$(time$,2))
280 dim w$(20),s$(20)
290 for j = 1 to 20
300 read w$(j)
310 next j
320 for j = 1 to 20
330 read s$(j)
340 next j
350 return
360 rem ** data **
370 rem ** single words **
380 data "scurrying","trading","gazing","withered","chiselled"
390 data "muffled","flanked","writhed","bending","twisting"
400 data "hammered","hanging","winding","clearest","weary"
410 data "earthworld","cataract","sacrificial","slippery","assunder"
420 data " ** short phrases **"
430 data "in" "the" "cool" "stream"
440 data "nodded in clustered grace"
450 data "waves" "of" "coolness"
460 data "out from the deepest"
470 data "sullen","sullen"
480 data "in the black darkness"
490 data "i" "take" "your" "poems"
500 data "i put out the lamp"
510 data "my" "short" "span" "runs" "out"
520 data "those" "that" "are" "left"
530 data "men or learning"
540 data "men" "of" "action"
550 data "I" "HURRY" "FORWARD"
560 data "WHY" "SHOULD" "YOU" "WASTE"
570 data "WHEN" "SHALL" "WE" "MEET"
580 data "LITTLE" "SLEEPING"
590 data and "MUCH" "GRIEVING"
600 data for "THOS" "FEW" "STEPS"
610 data "NOW" "AT" "DUSK"
620 data "I" "HAVE" "DONE" "WITH" "PROFIT"

 >> Stay informed about: need help debugging old school BASIC program 
Back to top
Login to vote
Simon Slavin1

External


Since: May 16, 2004
Posts: 625



(Msg. 2) Posted: Sat Jun 26, 2004 6:56 pm
Post subject: Re: need help debugging old school BASIC program [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 24/06/2004, Marco wrote in message
<NJFCc.4997$lL2.387068@twister.tampabay.rr.com>:

 > this basic program (simple poetry-generating program) keeps giving me
 > errors.

/What/ errors ? Tell us what it says and when.

 > 430 data "in" "the" "cool" "stream"

Aren't you meant to have commas in there ?

Simon.
--
Using pre-release version of newsreader.
Please tell me if it does weird things.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: need help debugging old school BASIC program 
Back to top
Login to vote
Not Important

External


Since: Feb 28, 2004
Posts: 42



(Msg. 3) Posted: Sun Jun 27, 2004 5:36 am
Post subject: Re: need help debugging old school BASIC program [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <cbkulb$751$1$8302bc10@news.demon.co.uk>,
Simon Slavin
<slavins.delete.these.four.words.RemoveThis@hearsay.demon.co.uk> wrote:

 > On 24/06/2004, Marco wrote in message
 > <NJFCc.4997$lL2.387068@twister.tampabay.rr.com>:
 >
  > > this basic program (simple poetry-generating program) keeps giving me
  > > errors.
 >
 > /What/ errors ? Tell us what it says and when.
 >
  > > 430 data "in" "the" "cool" "stream"
 >
 > Aren't you meant to have commas in there ?
 >
 > Simon.

Actually..., no!

Those look to be meant as complete one line strings.

The first 20 are single words, the next 20 are single line
phrases. Thus that should be -

430 data "in the cool stream"

Of course it's been over 20 years since I've done anything with
BASIC and I don't remember it very much.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: need help debugging old school BASIC program 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
RE: need help debugging old school BASIC program - 10 rem hanshan 20 gosub 250 : rem initialize 30 rem choose pattern 40 r = int(rnd(1)*3)+1 50 on r gosub 90,140,190 60 for t = 1 to 2500 : next t 70 print : print : print 80 goto 40 90 rem ** pattern one ** 100 color 14 : print..

old school offscreen graphics - Hello, I've been here some months ago with my questions about System-6 compatible C programming, on various topics. I'm currently very close to having a very useful function which sets a BitMap memory space and draws graphics in it, off the screen, so..

Old school (?) drawing philosophy - I finally have a serviceable 2d image drawing engine working under System 1.0 through OS 9.2. I can draw arbitrary sized multi-frames sprites, with (pre-generated) white masks, if needed, and with auto-cleaning (saves background in temp bitmap and draws....

Old school, coming back again. - I started programming for Mac back in the OS 5 days, through OS X 10.1, all the time using the (what is now called) the Carbon API. Now my boss has asked me to write an application for "low end Macs". I'm assuming that "low end" no l...

Debugging with PB... - I have a Mach-O application that I'm trying to debug. I haven't really touched gdb since college, but I was trying to use the PB debugger (which is just gdb with a UI, as far as I can tell). The problem is, I can't get it to work. The application runs...
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]