unitialized variables Thread last updated on 2003-09-23 09:25:47

Posted by member 59021 on 2003-09-08 06:12:42

hi,
Being new to this forum (and relativley new to Litestep) I thought I'd carry on a fine tradition of "n00bness" by asking what will probably turn out to be a simply answered question:

Why, when I install some themes do I get the message "unititalized variable $resolutionx -440$ at line *blah blah" or something similar?

i'm quite comfertable with editing .rc files and I have located the line(s) that cause this with no problem. But what I need to know is how to FIX this. What do I change the line to?

Thanks muchley

Concept

Posted by member 7223 on 2003-09-08 06:18:02 link

Are you sure you have a recent Indiestep or the last .24.7 ?
Maybe $resolutionx-440$ (without the " " before the "-") should work ?

Posted by member 1783 on 2003-09-08 11:20:34 link

does the step.rc have that whitespace between "x" and "-"? if it is, then know that it shouldn't ;)

Posted by member 37809 on 2003-09-08 12:15:50 link

You can also quote the value, like so:
myBlah "$ResolutionX - 440$"

hrm.. couldn't the step parser treat $'s like "'s?

Posted by member 59021 on 2003-09-09 10:12:15 link

thats what I thought...

I'll have a much more detailed look through the step.rc tonight and see if I can fix it.

It does surprise me though that a problem that seems so widespread (I've had it with a couple of theme's, and read of it on a number of occasions) doesn't seem to have a definitive solution.

Posted by member 7 on 2003-09-09 11:07:04 link

Umm... WFM... spaces in var names should be no problem.

Posted by member 59021 on 2003-09-10 11:14:07 link

but if its enclosed in $'s and is defined as $variableX$ them trying to use $variable x$ will result in an error. Though I don't think that this is the problem.

If I remeber from my programming days (all 365 of them!) them an unitilized variable is one that is defined but not used, but I could be wrong...

Posted by member 7 on 2003-09-10 13:14:09 link

Well $variable x$ won't work for the obvious reason that there is no variable called "variable x". Spaces aren't stripped from the string. But $ExistingVar + 2$ should work just fine.

Posted by member 99 on 2003-09-10 20:39:24 link

An uninitialized variable is one that has not been initialized. ie, no value is supplied for it. In step.rc that means you're trying to use something without telling litestep what it is.

Make sure "resolutionx" is spelled correctly.
Make sure that - is really a - and not some funky non-ascii char.
Make sure you are using a version of litestep that supports math withing $$s. (try !alert "$1+1$" from a command box or lscp)

If all else fails, get an EXACT copy of the error message (try copy+paste) and the line it refers to.

Posted by member 37809 on 2003-09-10 22:45:00 link

(Just to clarify my first post)
abc 123
dog 41
cat $abc / dog$ ; invalid
emu $abc/dog$ ; valid
cow "$abc / dog$" ; valid

!alert "$cat$" gives me abc. I'm not saying that litestep should handle $'s in pairs though; quotes are enough.

Posted by member 59021 on 2003-09-11 09:04:09 link

I have found that sometimes just using $$ is not enough, and you need to quote as well (ie. "$blah$" rather than $blah$) but I don't know why this should be.

By the way do you think this problem could be to do with me installing the theme wrong, or because the ste.rc is badly written by the author?

Posted by member 534 on 2003-09-22 07:58:22 link

Isn't that simply because LS is taking the spaces in the same manner as if you had :

programfilesdir C:\program files

such that $programfilesdir$ would be c:\program

I guess it just needs the themer to think a little, or for "" to be assumed around $$ enclosed areas *shrug*

Posted by member 36955 on 2003-09-22 19:36:25 link

this post has a good explanation of the reasons for quotes with evars

Posted by member 59021 on 2003-09-23 09:19:53 link

ech, maybe it really is that simple! Though could progra~1 not be used as a substitute? Seeing as it has no spaces in it but it still points to the right location. It works in DOS anways.

Posted by member 59021 on 2003-09-23 09:25:47 link

To be frank though, I am sick to death of this problem. Every time I try to load a new theme something is wrong. Often I can fix it no problem, but occasionally (as with this resolution buisness) I have no clue. So, I will stick with the only theme that I have found that has worked perfectly form the get go with minimal step.rc editing whcih is shell0. Thank you so much, however, for making it more obvious how the step.rc reads paths.