Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 56
  1. #21  
    Hi, I've got a small poll there...

    as most of you know, MortScript uses different comparisons for strings (eq, ne, le, ...) and numbers (=, <>, <, ...), which also leads to some troubles with newbies that use something like "a" = "b", which results in TRUE because it compares 0 with 0 (both aren't valid numbers, so they're converted to 0).

    Up to V4.0, I had no other choice but using different operators, because all values were stored and passed as strings.
    In the V4.01 alphas (and soon to be betas), this has changed, because I couldn't save floating point values as strings (at least not without high memory usage and huge rounding errors).
    This means, I would be able to determine the comparison type depending on the used values. "123" = 123 would be a numeric comparison (one of the operators is numeric), "a" = "b" an alphanumeric, and so on.

    However, there are two big drawbacks:
    - Compatibility with old scripts. Maybe someone really wants to compare two strings as numbers. E.g. a text input and an ini value, which both are always returned as strings.
    - Not all values are the type you might expect. Additionally to the two mentioned above, e.g. GetTime returns strings, to include a leading 0, which is handy to create filenames from dates. Even with casting functions (like Int( myString )) or using operators (string * 1, number & "", etc.) it would be another source of errors...

    So what do you think?
  2. #22  
    I voted for keeping it as is
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  3. #23  
    Currently you seem to be a minority, but there aren't many votes yet...
    I'm a bit indifferent about it... I've got a bad feeling about compatibility breaks, but on the other hand it's a bit nasty to get the same "error" report again and again... And it shouldn't cause too many compatibility problems, because most numerical comparisons use a number operator anyway, like "If ( var = 1 )".
    I wish there was a good compromise which keeps backward compatibility, but I can't find one. The "best" idea I had was keeping the existing operators as they are and add == and != for type dependant comparisons. But 1st, nobody would use them, if he sees only the old operators in old examples. And 2nd, you'd expect the handling rather the other way around: BASIC style operators for type dependant, and C style operators for numerical comparisons. If you'd expect different handling at all.
  4. #24  
    Yeah, over 70 views, but only 6 votes.
  5.    #25  
    hmm, I think I'm going to agree with scotty on this one. I vote to keep it as is. Something tells me any issues that come out of this new = operation might be more confusing than knowing that you have to use = for number compare and eq for string compare. The current behavior is well defined. The new behavior seems to be a bit murky and at the cost of compatibility.
  6. #26  
    Hmm... another approach would be to show an error message when using = and one of the operators is a string that doesn't contain a valid number.
    But again there might be scripts that do that on purpose, like If ( Length(input) > 0 AND input <> 0 ) to check for a valid number.
    And doing it at errorlevel warn wouldn't be of much use, because most people won't modify the default (error).
    Hmm... maybe show an error if both values are invalid strings?
  7.    #27  
    Quote Originally Posted by sto-helit View Post
    Hmm... maybe show an error if both values are invalid strings?
    That sounds good to me.
  8. #28  
    b12:
    - CompareFloat( number, number, precition ) to compare float values
    - Red( color ), Green( color ), and Blue( color ) to get the color part of ColorAt or RGB values
    - HexToNumber( hex string ) and NumberToHex( int value ) to convert numbers to hexadecimal strings and back
    - new replacements in FormatNumber: {M}=>Month short (Jan), {MM}=>Month long (January), {W}=>Day short (Mo), {WW}=>Day long (Monday).
    - ElseIf
    - Bugfix in Replace function
    - Bugfix when using empty parameters (like SleepMessage( 5, "Text", , 1 ))
    - Error when using numerical compare operators with two strings that don't contain numerical values (like "a" = "b")
    - Slightly improved finding windows (WndExists, WaitFor, ...)
    - Updated english manual included
  9. #29  
    WOW, I just saw that on the forum and I was just about to post my findings here. EXCELLENT JOB!

    I posted my comments on your forums.

    BTW, thanks for updating the manual regarding string/int.
  10. #30  
    Is 4.01 b12 the latest stable build that all our mortscripters are using these days?
  11.    #31  
    That's what TA uses and it's working great.
  12. #32  
    b14:
    - Predefined variables (like TRUE, FALSE, PI, ...) remain global after Local()
    - Global( variables ) allows to access the given global variables while everything else (except predefined variables) is local()
    - Support to assign (copy) and return arrays (array2 = array1, Return( array ))
    - Support of multi dimensional arrays (e.g. array["screen1"][x][y])
    - [expression] allows to access/assign the variable with the name that's returned by the expression, i.e. [arrRef&"[1]"] gets/assigns the first element of the array which name is set in arrRef. This is some kind of mixture between %...% references and Expr(), which works almost everywhere, e.g. [arrRef&"[1]"] = SubStr( [strRef], 1, 3 ) or GetTime( [hourVar], [minVar], [secVar] )
    - New functions ArcSin, ArcCos, ArcTan
    - Bugfixes in SelectFile and SelectDir dialogs, esp. in Smartphone edition
    - ForEach IniKeys fixed (got accidently corrupted when introducing RegValues loop)
  13.    #33  
    Excellent work as always Mort! I'm looking forward to using the new features. :-)
  14. #34  
    Any plans for PurgeArray soon?
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  15. #35  
    Quote Originally Posted by scottymomo View Post
    Any plans for PurgeArray soon?
    You can use Clean() for both the entire array as well as single elements.
  16. #36  
    cool, will check it out!
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  17. #37  
    Quote Originally Posted by sto-helit View Post
    You can use Clean() for both the entire array as well as single elements.
    You meant Clear() right?

    Works great! Thanks!
    Palm III > HS Visor > Treo 600 > Treo 650 > Treo 750 > Treo Pro > PrePlus GSM

    "95% of all software issues are due to USER ERROR."
  18.    #38  
    oops, getting behind on Mort's updates. MortScript 4.01 is now up to beta 21!

    Changes:
    b15
    - Array( value {, value } ), Map( key, value {, key, value} ), and Split( string, separator [, trim? ) functions to initialize arrays
    - Question shows an error if the query type is invalid (i.e. not "YesNo", "YesNoCancel", etc.)
    - DelTree allowes paths without file filter (DelTree("\Temp") works like DelTree("\Temp\*.*"))
    - RefreshToday also updates a newly set background image
    - Activating running scripts (if script was invoked a second time) should work more reliable
    - setup.dll allows to give an install.mscr outside of the installation directory with HKCU,Software\Mort\MortScript\setup.dll,Path,0x00000000,"\some\path" in the registry section of the cab's .inf file

    b16
    - Removed overlooked debug message
    - Fixed bug with \ operator
    - Experimental: RegRead returns an array for MultiString values

    b17
    - Major internal code restructuring
    - PNA version: Now works without toolhelp.dll, but procExists and activation of already running scripts won't work anymore. Kill implicidly launches external tool killproc.exe which will only work on PNAs with toolhelp.dll.
    - PNA and Smartphone versions: SystemPath( "ScriptExe" ) now should work
    - RegWriteMultiString( root, key, value, array ) for multi string entries
    - CallScript(Function) uses current script's path if no path was given

    b19
    o Kill and procExists work on PNAs with toolhelp.dll, on others there'll be an error message. KillProc.exe is no longer required.
    o New commands and functions (currently only in commands.txt, documentation will follow...):
    -- SendMessage( [window,] message id, wparam, lparam ) and PostMessage( [window,] message id, wparam, lparam ). SendMessage also works as function (returns the message handlers result), both only work with numerical parameters.
    -- TotalDiskSpace( path ) (max. 2GB)
    -- BackupBatteryPercentage()
    -- MaxIndex(array) and ElementCount(array). MaxIndex returns the biggest numerical index starting with 1, ElementCount returns the total numer of elements including alphanumerical indexes and cleared elements.
    o Rename with overwrite doesn't delete old file if new doesn't exist
    o Bugfix: SystemPath( "ScriptExe" ) should work on PNAs
    o Bugfix: CallScript(Function) without script path now uses active script's path correctly

    b21
    - Fixed "If procExists" error on PNAs (old style, not to mix up with ProcExists() function)
    - Added "SetMessageFont" command. It works for BigMessage, SleepMessage, and Input, but not for Message and Question because those use a system dialog which doesn't allow to change the font.

    http://www.sto-helit.de/index.php?mo...=view&entry=85

    Thanks Mort!
  19. #39  
    Now it's b22. No big news, just some (mostly minor) bugfixes.
    For me, it's a release canditate, but experiences with MortPlayer made a bit careful with "RC" versions...
  20. #40  
    b25 - added some new features, too. I hope it's the last update before the release...
Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions