Notifications
Clear all

[Closed] how to make things difficult

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.

3 Replies

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.

well, nevermind. i finally figured this thing out.
seems like i put * 35 in the wrong place.

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.