Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execscript() Crashing Build -- Bug?
Message
General information
Forum:
Visual FoxPro
Category:
Project manager
Miscellaneous
Thread ID:
01175348
Message ID:
01175364
Views:
7
Strange, but it works on my computer:
on key label "F3" execscript( ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)  + ;
        "" + chr(13) + chr(10)  + ;
        "" + chr(13) + chr(10)  + ;
        "local lcTagName" + chr(13) + chr(10)+;
        'WAIT WINDOW [aaaaaa]')
When I save it in PRG and run that prg after I press F3 I see WAIT WINDOW. Maybe I am missing something.


>Looks like a bug.to me. Teh following simplified code also blows up build on my PC
>   on key label "F3" execscript( ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  + ;
>        "" + chr(13) + chr(10)  + ;
>        "" + chr(13) + chr(10)  + ;
>        "local lcTagName" + chr(13) + chr(10)  )
>>
>
>>I stumbled upon an unexpected problem found in both VFP 8 SP1 and 9 SP1.
>>
>>Background: I added additional lines to our original EXECSCRIPT() parameter and, from the command window, the changes ran fine. (This EXECSCRIPT() parameter string is legal.)
>>
>>However, whenever I attempted to compile the project it quickly crashed with the dreaded C000005 error. The identical behavior occurs on my manager's machine. Changing the FOXUSER resource file, my first guess, makes no difference.
>>
>>A workaround is to add the parameter value indirectly via a variable. Is this a bug or is this behavior documented? Simple repro code follows:
>>
>>#IF ( .T. )
>>    * This builds just fine
>>    lcOnF3Script =  ;
>>        "local lcTagName"       + chr(13) + chr(10) + ;
>>        "local lnTagHit"        + chr(13) + chr(10) + ;
>>        "gcHowExited='F3'"      + chr(13) + chr(10) + ;
>>        "select 'AltProvFacil'" + chr(13) + chr(10) + ;
>>        "ATagInfo(laTheTags,'AltProvFacil')"    + chr(13) + chr(10) + ;
>>        "lnTagHit = ascan( laTheTags, 'SSN', -1, -1, 1, 15 )"  + chr(13) + chr(10) + ;
>>        "if ( empty( m.lnTagHit ) )"                           + chr(13) + chr(10) + ;
>>        "    lnTagHit=ascan( laTheTags, 'TIN', -1, -1, 1, 15 )"+ chr(13) + chr(10) + ;
>>        "endif"    + chr(13) + chr(10) + ;
>>        "lcTagName=laTheTags[ m.lnTagHit, 1 ]"    + chr(13) + chr(10) + ;
>>        "lcTagName=iif(order()=='DISPLORDER', m.lcTagName, 'DisplOrder' )" ;
>>            + chr(13) + chr(10) + ;
>>        "set order to (m.lcTagName)"    + chr(13) + chr(10) + ;
>>         "KEYBOARD '{Esc}' plain"
>>    * Inserting the parameter text using a varialble
>>    on key label "F3"    execscript( m.lcOnF3Script )
>>#ELSE
>>    * This crashes a build under both VFP 8 SP1 and VFP 9 SP1
>>    *
>>    * Inserting the same text directly causes a C0000005 error when
>>    * the project is built and yields no clue as to the cause!
>>    *
>>    * (Note: In a .PRG run from the command line the following
>>    * will run without problem -- until a build is attempted.)
>>    *
>>    on key label "F3" execscript( ;
>>        "local lcTagName" + chr(13) + chr(10) + ;
>>        "local lnTagHit"        + chr(13) + chr(10) + ;
>>        "gcHowExited='F3'"      + chr(13) + chr(10) + ;
>>        "select 'AltProvFacil'" + chr(13) + chr(10) + ;
>>        "ATagInfo(laTheTags,'AltProvFacil')"    + chr(13) + chr(10) + ;
>>        "lnTagHit = ascan( laTheTags, 'SSN', -1, -1, 1, 15 )"  + chr(13) + chr(10) + ;
>>        "if ( empty( m.lnTagHit ) )"                           + chr(13) + chr(10) + ;
>>        "lnTagHit=ascan( laTheTags, 'TIN', -1, -1, 1, 15 )"    + chr(13) + chr(10) + ;
>>        "endif"    + chr(13) + chr(10) + ;
>>        "lcTagName=laTheTags[ m.lnTagHit, 1 ]"    + chr(13) + chr(10) + ;
>>        "lcTagName=iif(order()=='DISPLORDER', m.lcTagName, 'DisplOrder' )"    ;
>>            + chr(13) + chr(10) + ;
>>        "set order to (m.lcTagName)" + chr(13) + chr(10) + ;
>>         "KEYBOARD '{Esc}' plain"     )
>>#ENDIF
>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform