Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Stumped with making my first function / SOLVED


  • Please log in to reply
3 replies to this topic
Stefan V
  • Members
  • 78 posts
  • Last active: Oct 11 2010 03:51 AM
  • Joined: 16 Jun 2009
I just wanted to test making a simple function and I'm such an idiot xD
Charnumber(char)
{
msgbox %char%   ; There is a problem here. The message box is blank
Transform, output, ASC, %char%
output -= 96
Msgbox %output%
}
Charnumber(c)
return





f12:: ; testing purposes
abc = h
transform, number, asc, %abc%
msgbox %number%


JohnnyTwoTone
  • Members
  • 45 posts
  • Last active: Mar 29 2011 02:51 AM
  • Joined: 10 May 2009
c has no value there.

Charnumber("c")

letter=h
charnumber(letter)



abody
  • Guests
  • Last active:
  • Joined: --
Function arguments are expressions.
So, the call to your function should be:
Charnumber("c")

or
character = c
Charnumber(character)


Stefan V
  • Members
  • 78 posts
  • Last active: Oct 11 2010 03:51 AM
  • Joined: 16 Jun 2009
Thanks for the help. That was a silly mistake ^.^