[futurebasic] Re: [FB] Getting a error on Dim As Str255

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2004 : Group Archive : Group : All Groups

From: Steve Flavel <stevef@...>
Date: Tue, 26 Oct 2004 08:27:02 +0800
> Ok I tried both solutions provided by 2 different people and my program
> still unexpectantly quits (doesn't work)
> 

Oops maybe it is the variable answer that needs to be DIMensioned?
Dim As Str255 answer

Steve
> Brian
> 
> 
> On Oct 25, 2004, at 4:35 PM, Brian Heibert wrote:
> 
>> Dim As Str255
> 
> The error message is mostly clear. This dim line doesn't provide a
> variable name. Using this DIM syntax a correct definition would be:
> 
> Dim As Str255 MyStr
> 
> BTW:  When the compiler points to a specific statement, a quick trip to
> the reference manual can be helpful.
> 
> --
> 
> 
> 
> 
> On 10/25/04 6:47 PM, "Steve Flavel" <stevef@...> wrote:
> 
>>> LOCAL FN doInput
>>> Dim As Str255
>>> Dim As Handle H
>>> 
>>> Route _toAppleScript
>>> Print "display dialog """""+myr$+"""" enter your answer """""
>>> Print "return text returned of result"
>>> Route _toScreen
>>> 
>>> Long If Usr AppleScriptRun( answer ) = _noErr
>>> Long If answer[0]// if answer is not empty
>>> answer[0]--// remove trailing quote
>>> answer = Mid$( answer, 2 )// remove leading quote
>>> Edit$( 1 ) = "Hello "// add something to EF
>>> Edit$( 1, _maxInt,_maxInt ) = answer + Chr$(13)
>>> SetSelect _maxInt,_maxInt
>>> End If
>>> Xelse
>>> Edit$( 1 ) = "Error! Couldn't run AppleScript."
>>> End If
>>> H = Usr AppleScriptGetResult
>>> If H Then DisposeHandle( H )
>>> END FN
>>> 
>>> Ok I have that Fn (above) and this:
>>> CASE UCASE$(LEFT$(lineStr,6)) = "INPUT "
>>> myr$ = MID$(lineStr,7)
>>> Fn doInput
>>> 
>>> But I am getting the following error:
>>> On this line:  Dim As Str255
>>> 
>>> 
>>> Error: A Variable was expected here???
>>> in file TBASIC.proj:TBASIC.MAIN at line 314 in doInput
>>> €Dim As Str255€
>>> 
>>> Try Dim myr$ or
>>> Dim as STR255 myr  {You need to put a variable after STR255}
>>> 
>>> Steve
>>> --
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> --
>> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
> 
> --
> 
> 
>