|
#1
|
|||
|
|||
|
function creation
When making functions how do i enable it so i can use EG:
_Left or _Right not "_Left" or "_Right", I really can't work it out any ideas? as this would clean up my functions and also help with my plugin ![]() Rex |
|
#2
|
|||
|
|||
|
Is this right
Ok am i right in thinking i have to defind them vebs before
_Right = "_Right"; _Left = "_Left"; Rex |
|
#3
|
|||
|
|||
|
Ok new problem.
I get my others working and say i do Get(_Right, eType); and the Get is function Get(_Right, eType, eName); eType..Prop = eType.GetPos(eName); end i get a error bla bla =; I want to streal line a function to do many things and i need to do this how can i do it? Why can't i dynamicly get set my verbs? |
|
#4
|
||||
|
||||
|
Quote:
Streal line a function? Dynamically set verbs? Also I don't think this is Lua.. Code:
eType..Prop = eType.GetPos(eName); Code:
eType.Prop = eType.GetPos(eName); |
|
#5
|
|||
|
|||
|
Not sure what i was trying to way there sorry lol i will explane again silly me.
Ok i have a function Something(_Img, "Image1"); function Something(eType, eName) if eType == _Img then ImageName Doelseif eType == _Label then LableName Doend end what i want do do is insted of all the else ifs i wants to make the sting to right the Veb Dynamic aka eType.SetVisable(eName); I have manual did the if commands for now but i was just thinking od a way to shorten my functions. |
|
#6
|
|||
|
|||
|
Code:
function SetVisible(MyObject)
TheObj=Page.GetObjectType (""..MyObject)
if TheObj == 0 then Button.SetVisible(""..MyObject, true)
elseif TheObj == 1 then Label.SetVisible(""..MyObject, true)
elseif TheObj == 2 then Paragraphl.SetVisible(""..MyObject, true)
elseif TheObj == 3 then Image.SetVisible(""..MyObject, true)
--etc for the rest of the objects
end
end -- function
I'm certain that someone with the skills could write a plugin or dll to accomplish this also...but why...? The above example should set any object on a page visible (you will have to include the "elseif logic" for the remainder of the AMS objects of course. You could easily convert the coding to a table structure as well. SetVisible("AnyObject") You could create similar function for "SetInvisible", "SetEnabled", etc. hth Last edited by holtgrewe; 1 Week Ago at 08:53 AM. |
|
#7
|
||||
|
||||
|
Quote:
Code:
""..MyObject Code:
MyObject Code:
function SetVisible(MyObject) TheObj=Page.GetObjectType (MyObject) MyObject = tostring(MyObject); if TheObj == 0 then Button.SetVisible(MyObject, true) elseif TheObj == 1 then Label.SetVisible(MyObject, true) elseif TheObj == 2 then Paragraphl.SetVisible(MyObject, true) elseif TheObj == 3 then Image.SetVisible(MyObject, true) --etc for the rest of the objects end end -- function |
|
#8
|
|||
|
|||
|
Thanks for pointing that out. It's so great having a code monitor looking over our shoulder to point out our coding flaws...LOL
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT -6. The time now is 02:11 AM.










Linear Mode
