[main] Title=GetInterface test Description=Running custom commands Level=5 Version=1 Selected=None [Interface] pTextBox1=pTextBox1,1,0,12,33,200,18,"GetInterface Test" pButton1="Run Slow_Code",1,8,22,90,111,33,Slow_Code pRadioGroup1=pRadioGroup1,1,14,23,154,150,150,Option1,Option2,Option3,0 [variables] GetInterface=Run,%ScriptFile%,Get_Interface,OUT: WriteInterface=Run,%ScriptFile%,Write_Interface %File%=%ScriptFile% [process] Run,%ScriptFile%,Fast_Code //Run,%ScriptFile%,Slow_Code //pTextBox1=pTextBox1,1,0,12,33,200,18,"GetInterface Test" //pButton1="Run Fast_Code",1,8,22,90,111,33,Fast_Code //pRadioGroup1=pRadioGroup1,1,14,23,154,150,150,Option1,Option2,Option3,1 [Slow_Code] GetInterface,%Result%,%File%,pTextBox1 If,%Result%,Equal,"GetInterface Test",Begin Message,"Change pTextBox1 [GetInterface Test] by [GetInterface Test (Demo)]",INFORMATION,10 WriteInterface,"GetInterface Test (Demo)",%File%,pTextBox1 End Else,Begin Message,"Change pTextBox1 [GetInterface Test (Demo)] by [GetInterface Test]",INFORMATION,10 WriteInterface,"GetInterface Test",%File%,pTextBox1 End GetInterface,%Result2%,%File%,pButton1 If,%Result2%,Equal,Slow_Code,Begin Message,"Change Buton Action [Slow_Code] by [Fast_Code]",INFORMATION,10 WriteInterface,Fast_Code,%File%,pButton1 Message,"Change Buton Text [Run Slow_Code] by [Run Fast_Code]",INFORMATION,10 WriteInterface,"Run Fast_Code",%File%,pButton1,,1 End Else,Begin Message,"Change Buton Action [Fast_Code] by [Slow_Code]",INFORMATION,10 WriteInterface,Slow_Code,%File%,pButton1 Message,"Change Buton Text [Run Fast_Code] by [Run Slow_Code]",INFORMATION,10 WriteInterface,"Run Slow_Code",%File%,pButton1,,1 End Message,"Change Buton Position" ,INFORMATION,10 WriteInterface,340,%File%,pButton1,Button,4 GetInterface,%Result3%,%File%,pRadioGroup1 If,%Result3%,Equal,0, Message,"Change pRadioGroup1 Selection to Option2" ,INFORMATION,10 WriteInterface,1,%File%,pRadioGroup1 System,REFRESHINTERFACE [Fast_Code] GetInterface,%Result%,%File%,pTextBox1,TextBox,8 If,%Result%,Equal,"GetInterface Test",WriteInterface,"GetInterface Test (Demo)",%File%,pTextBox1,TextBox,8 Else,WriteInterface,"GetInterface Test",%File%,pTextBox1,TextBox,8 GetInterface,%Result2%,%File%,pButton1,Button,8 If,%Result2%,Equal,Fast_Code,Begin WriteInterface,Slow_Code,%File%,pButton1,Button,8 WriteInterface,"Run Slow_Code",%File%,pButton1,Button,1 End Else,Begin WriteInterface,Fast_Code,%File%,pButton1,Button,8 WriteInterface,"Run Fast_Code",%File%,pButton1,Button,1 End WriteInterface,22,%File%,pButton1,Button,4 GetInterface,%Result3%,%File%,pRadioGroup1,RadioGroup If,%Result3%,Equal,1,WriteInterface,0,%File%,pRadioGroup1,RadioGroup,11 System,REFRESHINTERFACE [Write_Interface] Set,%Pos_End%,0 StrFormat,Len,#1,%_Len1_% StrFormat,POS,#1,#$s,#9 If,#9,Bigger,0,Begin If,#9,Smaller,%_Len1_%,Set,#1,#$q#1#$q End IniRead,#2,Main,Interface,%_Interface_% If,%_Interface_%,Equal,,Set,%_Interface_%,Interface IniRead,#2,%_Interface_%,#3,%_Component_% If,#4,Equal,,Begin StrFormat,LTRIM,#3,1,%_CpntName_% Loop,%ScriptFile%,TrimNum,0,10 End Else,Set,%_CpntName_%,#4 If,#5,Bigger,0,StrFormat,SPLIT,%_Component_%,#$c,#5,%_ValComponent_% Else,Begin Select_Case,%_CpntName_%,"TextBox|TextLabel|NumberBox|CheckBox|ScrollBox|RadioGroup|Image|TextFile|Button|WebLabel|RadioButton|FileBox","8|1|8|8|1|8|1|1|8|8|8|1" Set,#5,%Case% StrFormat,SPLIT,%_Component_%,#$c,%Case%,%_ValComponent_% If,%_CpntName_%,EQUAL,RadioGroup,Begin StrFormat,SPLIT,%_Component_%,#$c,0,#5 StrFormat,SPLIT,%_Component_%,#$c,#5,%_ValComponent_% StrFormat,LEFT,#7,2,#8 If,#8,Equal,__,Begin StrFormat,DEC,#5,1 StrFormat,SPLIT,%_Component_%,#$c,#5,%_ValComponent_% End End End StrFormat,LEN,%_Component_%,%_LENComponent_% If,#5,Bigger,1,Begin Loop,%ScriptFile%,GetPos,1,#5,"%_Component_%" If,%Pos_Star%,Equal,0,Set,%LeftResult%,"" Else,StrFormat,LEFT,%_Component_%,%Pos_Start%,%LeftResult% If,%Pos_End%,Bigger,%Pos_Start%,Begin StrFormat,Dec,%Pos_End%,1 StrFormat,LTRIM,%_Component_%,%Pos_End%,%RightResult% End Else,Set,%RightResult%,"" IniWrite,#2,%_Interface_%,#3,"%LeftResult%#1%RightResult%" End Else,Begin StrFormat,LEN,%_ValComponent_%,#6 StrFormat,POS,%_ValComponent_%,#$s,#9 If,#9,Bigger,0,Begin If,#9,Smaller,%_Len1_%,StrFormat,INC,#6,2 End Else,StrFormat,INC,#6,1 StrFormat,Dec,%_LENComponent_%,#6 StrFormat,Right,%_Component_%,%_LENComponent_%,%RightResult% IniWrite,#2,%_Interface_%,#3,"#1%RightResult%" End [Get_Interface] IniRead,#2,Main,Interface,%_Interface_% If,%_Interface_%,Equal,,Set,%_Interface_%,Interface IniRead,#2,%_Interface_%,#3,%_Component_% If,#4,Equal,,Begin StrFormat,LTRIM,#3,1,%_CpntName_% Loop,%ScriptFile%,TrimNum,0,10 End Else,Set,%_CpntName_%,#4 If,#5,Bigger,0,StrFormat,SPLIT,%_Component_%,#$c,#5,#1 Else,Begin Select_Case,%_CpntName_%,"TextBox|TextLabel|NumberBox|CheckBox|ScrollBox|RadioGroup|Image|TextFile|Button|WebLabel|RadioButton|FileBox","8|1|8|8|1|8|1|1|8|8|8|1" StrFormat,SPLIT,%_Component_%,#$c,%Case%,#1 If,%_CpntName_%,EQUAL,RadioGroup,Begin StrFormat,SPLIT,%_Component_%,#$c,0,#9 StrFormat,SPLIT,%_Component_%,#$c,#9,#1 StrFormat,LEFT,#1,2,#8 If,#8,Equal,__,Begin StrFormat,DEC,#9,1 StrFormat,SPLIT,%_Component_%,#$c,#9,#1 End End End [TrimNum] StrFormat,REPLACE,%_CpntName_%,#c,,%_CpntName_% [GetPos] If,Not,ExistVar,%Pos_End%,Set,%Pos_End%,0 Set,%Pos_Start%,%Pos_End% StrFormat,POS,#1,#$c,#9 StrFormat,LTRIM,#1,#9,#1 StrFormat,INC,%Pos_End%,#9