Axe Software Forums
  Quest Developer Forum
  $capfirst()$ function


Author Topic:   $capfirst()$ function
Luridii posted 29-07-2001 12:05 GMT     
I've made this procedure as part of my new battle system 4 q3b2a to correct the way the user types in items 2 equip.

define procedure <correct>
$lcase(#correct#)$
$capfirst(#correct#)$
end define

I tested this by putting tEsT as the #correct# string.

And back from it I got 'test'

? is there something wrong with the way I typed in the capfirst function?

carlii posted 29-07-2001 12:08 GMT          
no.
Luridii posted 29-07-2001 12:10 GMT          
I didn't think so...
Alex posted 29-07-2001 14:27 GMT          
The whole point of a function is that it returns a value, and you've got nothing to take the value the lcase and capfirst functions are returning.

Your code should look something like this:

define procedure <correct>
set string <correct; $lcase(#correct#)$>
set string <correct; $capfirst(#correct#)$>
end define

Luridii posted 29-07-2001 14:51 GMT          
Ooops, yes I forgot to put the set command in :o
Thanks it all works fine now :)
Wizard posted 31-07-2001 07:14 GMT          
Luridii, I just tested what you had.

define procedure <correct>
setstring <correct; tEsT>
setstring <correct; $lcase(#correct#)$>
setstring <correct; $capfirst(#correct#)$>
msg <#correct#>
end define

The result was:

Test

So your code is right. Maybe it is the version of ASL. I was using 285.

Wizard

Luridii posted 31-07-2001 09:01 GMT          
my initial code wasn't because i forgot the set string in front of the function! :o

Yeah i'm using 285