Results 1 to 3 of 3
  1.    #1  
    1. the result from iniread() lost case (Big -> big)

    2.filemodifytime() gave out weird results in windows xp, vista and pocket pc (wm5 and 6)

    3."Question" and "input" can't coexist in a subroute. (Only happened in PPC version)

    code like below won't run well in treo 750.

    if (Question("nice?"))
    callfunction("getYear",year)
    endif

    sub getYear
    Tyear=input("Year","year",true,false)
    return(Tyear)
    endsub

    4. There are several places that case sensitive, while a lot of places are case insensitive. It is very confusing. Please make a list of those functions which are case sensitive.

    5.bigmessage () won't response to ^LF^ while message () handle it well. For bigmessage it seems that ^NL" is the only way to get a new line.

    6. the implementation of variable scope is TERRIBLE. local() and grobel () just make it worse. All variable should be local default. Callscript () should never change the variables in the calling script.

    7. The quote in the string is also terrible . I never found a way to do something like this successfully.
    I want to run a script with two parameters, and never be able to do it.

    run(program, """"&SystemPath("Scriptpath") \ "menu.mscr"&""""e&" PARAM="&""""&"schedule"&""""&"SUBPARAM="&""""&"SUBPARAM"&quote)
    Treo 750 unbranded T-mobile, HTC WIZARD 8125 T-MOBILE (broken), Treo 650 T-mobile 1.43/1.14 OS 5.4.8 Garnet (sold).
    Dell X50v, X30 624Mhz and HP ipaq h2210 h1945.

    Treo 750 hacks thread.
  2. #2  
    Quote Originally Posted by cellneuron View Post
    1. the result from iniread() lost case (Big -> big)
    Never experienced that. Are you sure you read the correct file and did no string manipulation? Or maybe the key appears twice in the INI file?

    2.filemodifytime() gave out weird results in windows xp, vista and pocket pc (wm5 and 6)
    Strange, works fine for me. But some systems don't write correct modify times to the FAT, for example I know some digicams which write crap to the SD.
    You did read the result's a unix timestamp that has to be converted to a readable format with FormatTime? (But it's the same with TimeStamp()...)

    3."Question" and "input" can't coexist in a subroute. (Only happened in PPC version)
    I guess the input window doesn't appear fullscreen?
    That's a system bug on some devices. A short Sleep() before Input (or any other dialog box) seems to help in most cases. It seems like Windows sometimes gets confused if a program creates a window immediately after another's closed...

    4. There are several places that case sensitive, while a lot of places are case insensitive. It is very confusing. Please make a list of those functions which are case sensitive.
    Quite simple: Window titles and string operations are case sensitive. Variable names, array indexes, command and function names, etc. aren't. Fixed parameters (like "HKCU") usually are also case insensitive to avoid a possible error source.

    5.bigmessage () won't response to ^LF^ while message () handle it well. For bigmessage it seems that ^NL" is the only way to get a new line.
    Yeah, that's Windows... Different handling of the same data in different system components (both static text control and the "message" window are parts of the system)... I'll try to find a workaround...

    6. the implementation of variable scope is TERRIBLE. local() and grobel () just make it worse. All variable should be local default.
    If you like to rewrite all of the existing scripts, I'll gladly do so...
    Trouble is, MortScript startet as a simple batch language, so there were only global variables. So if I'd start to use local() as default, most of the scripts wouldn't run anymore, because they access global variables in Subs.
    Additionally, local scope variables, function parameter, and return values are quite hard to understand for beginners, so "everything's global" like in good old BASIC is better for starters.
    If you start to write more complex scripts, it's no big deal to write a Local() at the start of each function. It's still more easy than my( ... ) in Perl...

    Callscript () should never change the variables in the calling script.
    It was created to enable just that. For everything else, Run would have been sufficent. It's been a makeshift to allow some kind of subroutines before Sub and parameters were introduced. But as usual, nothing lasts longer than a makeshift...
    Btw., local() works fine for the main routine of a called script, too.

    7. The quote in the string is also terrible. I never found a way to do something like this successfully.
    It's quite simple. First quote opens the string, then every "" is treaded as a quote, until a single quote closes the string again.
    Admitted it looks quite confusing, but so far nobody (including me) came up with a better idea which is compatible to existing scripts (esp. "\" is completely impossible because it's used in lots of paths - and I'm quite happy I don't have to write "\\Windows\\Start menu\\Programs" like in C oriented languages...) and doesn't need lots of typing (like e.g. "^QUOT^").

    I want to run a script with two parameters, and never be able to do it.
    run(program, """"&SystemPath("Scriptpath") \ "menu.mscr"&""""e&" PARAM="&""""&"schedule"&""""&"SUBPARAM="&""""&"SUBPARAM"&quote)
    Well, the "quoted quotes" as such probably aren't the main trouble here. It would be similary weird if there'd be any other sign. E.g. replace all quoted ""s with #:
    run(program, "#"&SystemPath("Scriptpath") \ "menu.mscr"&"#"e&" PARAM="&"#"&"schedule"&"#"&"SUBPARAM="&"#"&"SUBPARAM"&quote)
    This string ("e" removed) would result in "#\MortScript\menu.mscr# PARAM=#schedule#SUBPARAM=#SUBPARAM" (and whatever's in quote).

    So what about
    run(program, """"&SystemPath("Scriptpath") \ "menu.mscr"" PARAM="""&schedule&""" SUBPARAM="""&SUBPARAM&"""")
    ("\MortScript\menu.mscr" PARAM="..." SUBPARAM="...")
    Last edited by sto-helit; 11/21/2007 at 04:24 AM.
  3.    #3  
    Thanks for the reply. Happy thanksgiving.
    Treo 750 unbranded T-mobile, HTC WIZARD 8125 T-MOBILE (broken), Treo 650 T-mobile 1.43/1.14 OS 5.4.8 Garnet (sold).
    Dell X50v, X30 624Mhz and HP ipaq h2210 h1945.

    Treo 750 hacks thread.

Posting Permissions