[futurebasic] functions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2012 : Group Archive : Group : All Groups

From: Spencer Ted <tedspencer50@...>
Date: Wed, 4 Apr 2012 10:48:55 -0400
Me again, and still lost...

Consider:


include "ConsoleWindow"

begin globals
dim as str255 gC1, gNewString
end globals

gC1 = "hello"

print gC1

local fn addToString
dim as str255 LField
gC1 = gC1 + " Fred"
end fn = LField

gNewString = fn addToString

print gNewString



The error is/errors are (depending on the computer I use, PPC or Intel):

Error: •• Arithmetic expression expected in line 16 of string test 2
 16:  end fn = LField
                   ^
On the PPC G4, it adds the converse error, namely that the calling line expected a string (which I thought it was).

Again, I'm missing a very trivial, but essential, point in this new (to me) FN world...

Ted