Make two fields... one button

button script...

on mouseUp
   put empty into fld 2
   
   put ("one","two","three","four","five","six","seven","eight","nine") into 
singleNumbers
   put 
("eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen")
 into mixedUpNumbers
   put 
("ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety") 
into tensNumbers
   
   put the number of chars of fld 1 into theCharCount
   -----------------------------------------------------
   if theCharCount = 1 then
      put item (char 1 of fld 1) of singleNumbers into theTextNumber
   end if
   -----------------------------------------------------
   if theCharCount = 2 then
      if char 2 of fld 1 = 0 then
         put item (char 1 of fld 1) of tensNumbers into theTextNumber
      end if
      
      if char 1 of fld 1 =  1 AND char 2 of fld 1 <> 0 then
         put item (char 2 of fld 1) of mixedUpNumbers into theTextNumber
      end if
      
      if char 1 of fld 1 > 1 AND char 2 of fld 1 <> 0 then
         put item (char 1 of fld 1) of tensNumbers into theTextNumber
         put space & item (char 2 of fld 1) of singleNumbers after theTextNumber
      end if
   end if
   -----------------------------------------------------
   if theCharCount = 3 then
      put item (char 1 of fld 1) of singleNumbers && "hundred" into 
theTextNumber
      
      if char 2 of fld 1 <> 0 then
         put " and" &&  item (char 2 of fld 1) of tensNumbers after 
theTextNumber
      end if
      
      if char 3 of fld 1 = 0 then
         put  item (char 3 of fld 1) of singleNumbers after theTextNumber
      end if
      
      if char 3 of fld 1 > 0 then
         put space & item (char 3 of fld 1) of singleNumbers after theTextNumber
      end if
   end if
   -----------------------------------------------------
   put theTextNumber into fld 2
end mouseUp

> 
> Hi any Idea on how to go about calculating numbers to text eg. 100, One
> Hundred, ?
> Thanks, Hershel

                                          
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to