PDA

View Full Version : how to make things difficult


dejawolf
06-25-2005, 05:39 PM
well, here i go again.

i wanted to create a simple script that takes a number from an edittext box,
multiply it by 35,
and then display the end result as a label, or in another edittext box.

in the process i managed to completely mess up everything.
and in the end i had no result.
i tried thoroughly to use the help file.. but well. nah. nothing.

in the end, i sit here frustrated by not being able to handle this mundane task.

dejawolf
06-25-2005, 06:03 PM
well, now i am all of a sudden am getting syntax errors at functions.

i am trying in vain to get this function to work.

function scale input =
(
input * 35
)

i figure i might be able to put this thing up later as a

scale.text in the label.
heh.

dejawolf
06-25-2005, 07:19 PM
well, nevermind. i finally figured this thing out.
seems like i put * 35 in the wrong place.

Impus
06-26-2005, 06:19 PM
I don't think its the * position it's more likely the structure of your function.. try this?

function customScaleFunc inputValue =
(
return (inputValue * 35);
)


then you can use it like this:

lbl_editbox2.text = (customScaleFunc (lbl_editbox1.text as integer)) as string;

You are better off using a 'spinner' however as it limits the inputs to numbers and then you wont have to worry about getting letters in your integer and the function failing.

CGTalk Moderation
06-26-2005, 06:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.