Goofy question about Datagrids

Sri sritcp at gmail.com
Sat Nov 5 17:31:11 CET 2016


Bob Sneidar-2 wrote
> Well I discovered that what you CANNOT do is call a user-defined command
> or function that has not been loaded yet, as in a front or back script
> that has not been inserted yet. If I do, when I open the stack I get an
> error. I suppose I could do the inserts in a preopen handler, but the
> scripts are contained in buttons in the stack that is not open yet. Not
> sure how that would play out.
> 
> Bob S

Bob,

May be I have not understood what you are trying to do, but a user-defined
function in the same script as the FillinData handler of the column in
question works perfectly for me.

<http://runtime-revolution.278305.n4.nabble.com/file/n4710097/before.png> 
Above is the original phone number format. I tried to convert it by adding
an fConvert function in the column behavior of the "Phone" column, as
follows:

on FillInData pData
   -- set the text of field 1 of me to pData
   set the text of field 1 of me to fConvert(pData)
 end FillInData
 
function fConvert pData
   set the itemDel to "-"
   return "(" & item 1 of pData & ")" &&  (item 2 of pData) && (item 3 of
pData)
end fConvert

It works perfectly; here's the image.

<http://runtime-revolution.278305.n4.nabble.com/file/n4710097/after.png> 

I hope the images show in the post (My post wouldn't make any sense
otherwise!)

Regards,
Sri




--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4710097.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list