[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

301.0. "BASIC error a little too harsh ?" by GAOV08::MAGIC (Conor Moran - Galway) Mon Sep 01 1986 15:38

	I'm sure everybody has seen this error before, but why does 
	BASIC access-violate horribly if (in immediate mode) you type

	10 dim foo(<large number>)
	run

	but 

	10 n=<large number>
	20 dim foo(n)
	run

	gives an aesthetically acceptable error message ?

	Its probably unreasonable to expect this to be allowed - I
	haven't really thought about how big an array you should be
	able to	dimension - but this error seems a little too harsh.
	The value of <large number> varies but usually >1050000 does
	the trick.

<CFM>
T.RTitleUserPersonal
Name
DateLines
301.1Different statementsWHYNOT::COWANKen CowanMon Sep 01 1986 18:3113
    For questions specific to VAX BASIC see the conference
    CLT::VAX_BASIC (press KP7).   However, while I'm here ...
    
    You have declared two different types of arrays, both of
    which live on the stack.   In the first case, the array
    get allocated when you program starts, we run out of
    stack space and die.  In the second case, the array
    gets allocated when the DIM gets executed -- we check
    the amount of stack space needed against what is available.
  
    Simple?
    
    	KC
301.2Hackers don't NEED immediate modeSANFAN::HAYESJOSame stuff, different DayTue Sep 02 1986 09:363
     
    ;-)
    John
301.3GAOV08::MAGICConor Moran - GalwayTue Sep 02 1986 09:3716
   Re .-1 

   What I really was asking was if BASIC had to die so dramatically.
   The reason I mentioned it was something reminded me of this happening
   to a novice user back in college. Said user had only just started 
   programming, and had never used a computer before. His first ass-
   ignment was to write a program which calculated all the prime 
   numbers between 1 and 10,000 (or something like that). He got the
   program working O.K. after a good bit of work, and decided to 
   experiment around. (Of course he had never been warned to take 
   backups - Silly, but thats not the point). He modified the program
   to go much further, and re-Dim'ed his arrays to a size he considered
   adequate. Needless to say, he wasn't over-impressed when running the
   program resulted in some antisocial error messages, and the DCL prompt.

<CFM>
301.4Valid point, but ...SANFAN::HAYESJOSame stuff, different DayWed Sep 03 1986 07:009
    But think how excited the novice user must have been at discovering
    his/her "first" hack!!! (how to make BASIC spill its guts...).
    
    Seriously, Conor, I wasn't trying to belittle your concern, which
    is valid.  I was just poking fun at the concept of putting an immediate
    mode BASIC problem in the 'Ackers conference.  Sorry if I got your
    dander up.
    
    John
301.5Oops ...GAOV08::MAGICConor Moran - GalwayWed Sep 03 1986 08:5113
     Re: .4

     Actually you didn't. That reply was addressed to .1 but you slipped
     yours in while I was editing it (1 minute would be a pretty fast
     turnaround). Sorry for any confuzion John.
<CFM>

P.S.  That'll teach me to use relative note references. I'll be a little
      more absolute from now on.  8^)

P.P.S Whats so funny about putting an immediate mode BASIC question
      in a hackers notesfile ? Anybody who can get any serious work
      done in immediate mode MUST be a hacker.