[futurebasic] Re: Wierd FB behaviour. Surely not my fault :-)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 1998 : Group Archive : Group : All Groups

From: tatewake@... (Terence Jordan)
Date: Tue, 20 Jan 1998 17:30:19 -0400
>>>I have the variables DIM'd like this at the start of the FN:
>>>CLEAR LOCAL
>>>DIM endBar,endFlag,64 p$,tint
>>
>>What's the 64 for? Just by looking at it I can say I don't recognise what
>>the heck your doing (in a nice way:-)
>
>Making the maximum length of the string 64 bytes...

I mean I thought the common convention for doing this is either:
dim p$.64
or
dim p$;64

I've never used:
dim 64 p$

And I don't think the p$ gets a length byte; as I recall you physically set
the length at 64 bytes. If you say:
p$="A", then p$ will equal "A"+63 bytes...

so saying
p$="A"
long if p$="A"
 BEEP
xelse
 BEEP:BEEP:BEEP
end if

You'll get a triple beep, 'cuz you never account for the other 63 bytes.

I "usually" don't do a "dim p$;20" unless I'm reading 20 bytes from a file
at a time...
But now I'm trying handles, so I almost never use strings anymore... :-)



-- Terence Jordan (tatewake@...)
Inspired Software. http://inspired.netstreet.net/
Macintosh, Dos, Windows, and BeOS software solutions.
Phone: 407-728-7563
............................................
. New: Renegade Space Ninja for Macintosh! .
.      Visit our page for more info.       .
............................................