Posted by member 32550 on 2004-04-15 12:00:13 link
that couldn't work
the textreplace sting is like:
!textreplace @path_and_file/to_search.rc@ @^string_to_search@ @string_to_relpace value@
it's much more easier to replace only a value then to change the whole string, cause if you want to change it again, you've write it complete new.
example:
now you can see that if you've tray = 1, the group 20 will be hidden on start, you can so you can use also new If loops with the $tray$ var, like:
the textreplace sting is like:
!textreplace @path_and_file/to_search.rc@ @^string_to_search@ @string_to_relpace value@
it's much more easier to replace only a value then to change the whole string, cause if you want to change it again, you've write it complete new.
example:
;test.rc
tray = 0
;theme.rc
If tray = 0
*NetLoadModule vtray-1.x
EndIf
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #19 !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 1@][!shortcutgrouphide 19][!shortcutgroupshow 20]
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #20H !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 0@][!shortcutgrouphide 20][!shortcutgroupshow 19]
tray = 0
;theme.rc
If tray = 0
*NetLoadModule vtray-1.x
EndIf
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #19 !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 1@][!shortcutgrouphide 19][!shortcutgroupshow 20]
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #20H !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 0@][!shortcutgrouphide 20][!shortcutgroupshow 19]
now you can see that if you've tray = 1, the group 20 will be hidden on start, you can so you can use also new If loops with the $tray$ var, like:
If tray = 0
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #19 !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 0@][!shortcutgrouphide 19][!shortcutgroupshow 20]
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #20H !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 1@][!shortcutgrouphide 20][!shortcutgroupshow 19]
ElseIf tray = 1
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #19H !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 1@][!shortcutgrouphide 19][!shortcutgroupshow 20]
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #20 !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 0@][!shortcutgrouphide 20][!shortcutgroupshow 19]
EndIf
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #19 !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 0@][!shortcutgrouphide 19][!shortcutgroupshow 20]
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #20H !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 1@][!shortcutgrouphide 20][!shortcutgroupshow 19]
ElseIf tray = 1
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #19H !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 1@][!shortcutgrouphide 19][!shortcutgroupshow 20]
*Shortcut "" 1024 -63 systray_right.bmp systray_righta.bmp .none #20 !execute [!textreplace @$ConfigDir$test.rc@ @^tray@ @tray 0@][!shortcutgrouphide 20][!shortcutgroupshow 19]
EndIf