Page 1 of 1

Need help with character code

Posted: Tue Aug 21, 2007 5:20 pm
by Taz
I'm trying to figure out what the command for changing characters in a certain field from uppercase to lowercase and vice versa is.

I've searched and looked through some of the sample scripts, but im still struggling to find it.

Please could someone help me out.

Posted: Tue Aug 21, 2007 5:39 pm
by malte
Hi,

try this: create a field "myField" and a button. In the button script place the following:

on mouseUp
local tProcessing,tOutput
set the casesensitive to true
put fld "myField" into tProcessing
repeat for each char theChar in tProcessing
if toLower(theChar)=theChar then
put toUpper(theChar) after tOutput
else
put toLower(theChar) after tOutput
end if
end repeat
put tOutPut into fld "myField"
end mouseUp

this inverts the case of all chars in the field.

Hope that helps,

Malte

Posted: Tue Aug 21, 2007 9:18 pm
by Taz
Thanks.

One last thing i wanted to ask is, for example

im trying to make this script do a repeat on a certain amount of fields

Now say if i have 5 fields. I want the script to input data into the fields accordingly and in order.

I'll execute the script, and i will input something for the first field, and then input something for the second field. Now i cancel it.

I click the script again, THIS IS THE PART I NEED HELP ON -

I want the script to skip the first 2 fields, and go on to the third, instead of just carrying on.

So this is what command i input -

if field "example" is empty not then (this part i don't know what to put).

I obviousy want it to skip the next part, and jus repeat.

Dam, i know this is so hard to explain, if u don't understand than don't worry about it, i'll figure out out eventually.

You've helped me alot on the char thing, so thanks again mate.