Can Super Edit move Userprops?

Questions regarding the Developer Edition's SuperEdit? This is the place!

Can Super Edit move Userprops?

Postby drpitcairn » Thu Jan 14, 2010 9:06 pm

I have some userprops that are in one wd. Can they be moved to another one in the same project? Been trying, but can't see how. User manual does not discuss it.

Thanks,
Richard
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Can Super Edit move Userprops?

Postby Dave_Higgins » Sat Jan 16, 2010 9:39 am

rpitcairn wrote:I have some userprops that are in one wd. Can they be moved to another one in the same project? Been trying, but can't see how. User manual does not discuss it.

Well, it could be easily scripted in SuperCard. Let's say you have the props in window 1 and want them in window 2...

Code: Select all
on moveProps
  put "myProp1,myProp2,myProp3" into tPropList
  -- if it's every user prop, then you can
  -- put the userProps of window 1 into tPropList
  repeat with i = 1 to the number of items of tPropList
    put item i of tPropList into tPropName
    do merge ("define [[tPropName]] of window 2")
    do merge ("set the [[tPropName]] of window 2 to the [[tPropName]] of window 1")
    do merge ("undefine [[tPropName]] of window 1")
  end repeat
end moveProps
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon

Re: Can Super Edit move Userprops?

Postby S. Leys » Sat Jan 16, 2010 9:48 am

[quote="Dave Higgins"]
Code: Select all
on moveProps
  put "myProp1,myProp2,myProp3" into tPropList
  -- if it's every user prop, then you can
  -- put the userProps of window 1 into tPropList
  repeat with i = 1 to the number of items of tPropList
    put item i of tPropList into tPropName
    do merge ("define [[tPropName]] of window 2")
    do merge ("set the [[tPropName]] of window 2 to the [[tPropName]] of window 1")
    do merge ("undefine [[tPropName]] of window 1")
  end repeat
end moveProps


Contrary to predefined properties, user properties name may be a variable. Thus you can do :
Code: Select all
on moveProps
  put "myProp1,myProp2,myProp3" into tPropList
  repeat for each item tPropName of tPropList
    define tPropName of window 2
    set the tPropName of window 2 to the tPropName of window 1
    undefine tPropName of window 1
  end repeat
end moveProps


Not tested but it should work.

S.
User avatar
S. Leys
 
Posts: 628
Joined: Sun Jul 06, 2008 11:03 am

Re: Can Super Edit move Userprops?

Postby Dave_Higgins » Sat Jan 16, 2010 9:53 am

Stephane Leys wrote: define tPropName of window 2
set the tPropName of window 2 to the tPropName of window 1
undefine tPropName of window 1

Wasn't sure about that, so I was being safe. 8-)
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon


Return to SuperEditing

Who is online

Users browsing this forum: No registered users and 2 guests

cron