Axe Software Forums
  Quest Developer Forum
  Grrrrrr...........now FUNCTIONS are giving me a hard time


Author Topic:   Grrrrrr...........now FUNCTIONS are giving me a hard time
Mega posted 13-10-2001 04:04 GMT     
Here we go again. This time, I was trying to define a simple function called Resolve. It doesn't really have the effect I want, it's just a little monitoring function right now. But even that doesn't work; it gets me a "No such function 'Resolve'" error message.

The code is:
define function <Resolve>
if ($numberparameters$ < 1) then msg <Error>
else {
set string <lookthing; $parameter(1)$>
if is <$instr(#lookthing#; at_)$; 1> or <$instr(#lookthing#; to_)$; 1> then {
set <lookthing; $mid(#lookthing#;3)$> }
if exists <#lookthing#> then {
msg <Exists>
return <#lookthing#>
}
else msg <Does not exist>
}
end define

And the line that calls the function is:
set <lookthing; $Resolve (#lookthing#)$>

What am I doing wrong NOW???

MaDbRiT posted 13-10-2001 08:06 GMT          
Hi (again) Mega

I used this:

quote:

msg <$Resolve(#object#)$>

Where #object# is the parameter of a command. This calling your function as subtly revised below...

quote:

define function <Resolve>
if ($numberparameters$ < 1) then msg <Error>
else {
set string <lookthing; $parameter(1)$>
if ($instr(#lookthing#; at_)$ = 1) or ($instr(#lookthing#; to_)$ = 1) then {
set <lookthing; $mid(#lookthing#;4)$>
msg <#lookthing#>
}
if here <#lookthing#> then {
msg <exists>
return <#lookthing#>
}
else msg <Does not exist>
}
end define

And that works fine.

Al

Mega posted 13-10-2001 17:32 GMT          
Thank anyway, but that didn't work. However, I did figure out what I was doing wrong. The function itself was fine; I was just defining it in the wrong place! *beats head against wall*