xTextEdit Problem Thread last updated on 2006-01-29 05:16:23

Posted by member 137182 on 2006-01-28 20:08:20

Hello,

i have a little problem with xTextEdit. My code is like this:

*Popup "Font Size" Folder
if FontSize = 12
*Popup "Small" !execute [!xTextReplace @$ConfigDir$themevars.rc@ @FontSize 14@ @FontSize 12@] [!recycle]
elseif FontSize = 14
*Popup "Tall" !execute [!xTextReplace @$ConfigDir$themevars.rc@ @FontSize 12@ @FontSize 14@] [!recycle]
*Popup ~Folder

But this doesn't work. Just the second part(if the Fontsize is 14) works. But if the FontSize is 12, the popup doesn't appear. Nothing happens.

Where is the error?

Posted by member 12025 on 2006-01-28 20:34:05 link

1. There are code tags on LS.net. They make this stuff much easier to read.
[ code ] ... [ / code ]
(but w/o the spaces, of course :))

2. I think you need to end the if block. Without a endif, everything after the elseif will be ignored if it is not true (so if it is 12, the pup never gets a ~New, or even the folder getting a ~Folder).
if FontSize = 12

*Popup "Small" !execute [!xTextReplace @$ConfigDir$themevars.rc@ @FontSize 14@ @FontSize 12@] [!recycle]

elseif FontSize = 14

*Popup "Tall" !execute [!xTextReplace @$ConfigDir$themevars.rc@ @FontSize 12@ @FontSize 14@] [!recycle]

endif

Posted by member 212670 on 2006-01-28 20:39:27 link

Not to mention, I think you have your entries backwards, too. If the font is 14, you're changing it to 14 again, and same with if it's 12.

Posted by member 12025 on 2006-01-28 21:22:09 link

Yeah, but that would at leats how the popup :)

Posted by member 212670 on 2006-01-28 23:37:56 link

Ya, I know YOU know that heh...It was for Houly's benefit. =)

Posted by member 137182 on 2006-01-29 05:16:23 link

Ah, thanks ;)

I've just changed the value cause i thought there was something wrong with it. Now it works perfect :)