Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By Electroguard
#57085 Yeah, ok livetv, it was only a suggestion rather than an issue.
It occured to me when trying to find why mmiscools stated flash variables example didn't work a few days ago, cos I didn't know if it was looking for a "No", "no", "NO", "Off" "off", "OFF" or "".

But then thinking about it some more, availability of an ANYCASE() seemed like it might be a useful and easily implemented added advantage, avoiding the need to have to convert both sides of a comparison.
It may not be appreciated for single page scripts, but I'm rewriting my EastNet script for V3, and it is already over 660 lines long, and still growing. One of the consequences of editing a long script is that when using script-wide variables, the edit is invariably a long way in time and distance from the original variable declarations. The difficuly is compounded by the fact that longer 'VariableNames' such as 'NodeIP' are often better in 'MixedCase', whereas other 'run-of-the-mill' flag variables are probably better 'off' in lower case, but many variables of greater significance are best unmistakingly SHOUTED. Unfortunately my memory is as reliable as a rubber ladder, so to avoid accidents with incorrect case I need to keep traversing through the 600 odd page script trying to find original declarations or usage, then finding my way back to where I was editing. There is no quick-jump bookmark feature, so the quicker alternative is just to bite the bullet and always convert both source and target variables for comparison... but that effectively doubles the amount of code needed for comparisons, and can result in the double-conversion comparison test no longer fitting on the same line.

Obviously Mmiscool is the prime mover, so I just try to offer feedback where I can in case it might help Esp_Basic be improved or progressed in directions he hadn't been looking. No problem for me if not though, cos Esp_Basic is already a triumph, and is so full of features that there's usually more than one way to skin a cat even if others aren't yet available. In this case (pun intended!), probably the easiest thing is for me to maintain a separate text file list of script variables which I can keep open to refer to without losing my script edit position. And I guess you're right about the difficulty of implementing it, unless perhaps along the lines of 'IF ANYCASE(Var1 <> Var2) then this or that', but it's probably not worth the bother. Anyway, thanks for taking the time to give it some thought.
User avatar
By Luc Volders
#57675 Maybe it's my ignorance but:

Code: Select allmyvar = "no"
if upper(myvar) == "NO" then print "result true"
myvar = "No"
if upper(myvar) == "NO" then print "result true"
myvar = "NO"
if upper(myvar) == "NO" then print "result true"


Every line prints "result true" and you do not need to alter the variable to het the result so what would be the added value of an ANYCASE statement ???

Even this works:

Code: Select allmyvar = "no"
myvar2 = "No"
if upper(myvar) == upper(myvar2) then print "result true"


Luc
User avatar
By Electroguard
#57679
Even this works... if upper(myvar) == upper(myvar2) then print "result true"

Yes of course converting the case of both sides of the comparison will result in matched case for the comparison:
Which has exactly been my only option all along, as in:
Code: Select allif upper(word(msg,1) == upper(name) then this = "yes" else this = "no"

You seem to have some other point to push, but I don't understand what it is, because what you are saying most obviously does NOT achieve:
...avoiding the need to have to convert both sides of a comparison.

as might be possible using something like the suggested:
IF ANYCASE(Var1 <> Var2) then this or that


So obviously did not understand or respond to those points I was making, and I am at a loss regarding what points you are trying to make, so rather than waste any more time throwing pointless rubbish on a lost cause, best to let the topic die a peaceful dignified death along with the unheaded repeated reminders of the missing ESP_Basic software pullups.
User avatar
By Mmiscool
#57680 Befor evry one gets in to a tizzy. I dont think this will be a feature that gets implimented. The upper and lower functions will have to surfice. I think it would require too much work on the function hander part of it to make it worthwile.