Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Truncated element from ASTACKINFO()
Message
De
11/09/2012 16:23:40
 
 
À
11/09/2012 15:39:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01552732
Message ID:
01552743
Vues:
47
>>Playing with ASTACKINFO() for a bit in trying to modify an error handler. I have a program called GLOOP and when i DO GLOOP I'm seeing some wierd results
>>
>>
>>**GLOOP.PRG
>>USE (mytable)
>>ab=111
>>DO rlpa
>>
>>** RLPA.PRG
>>ab=123
>>xx = 1
>>yy = 2
>>DO rlpb.prg
>>
>>** RLPB.PRG
>>ww="A"
>>DO rlpc
>>
>>** RLPC.PRG
>>lnStack = ASTACKINFO(aTmpStack)
>>
>>? atmpstack[1,6] ----> DO rlpa.pr
>>? atmpstack[2,6] ----> DO rlpb.pr
>>? atmpstack[3,6] ----> DO rlp
>>? atmpstack[4,6] ----> lnStack = ASTACKINFO(aTmpStack
>>
>>In all the programs there was nothing after the last character of the code. If I add a space or CRLF then the code from aTmpStack[n,6] prints as expected.
>>
>>Does anybody have an explanation as to why the last character would get truncated?
>>
>>All responses appreciated.............Rich
>
>Hi,
>
>I have following routine in my errorlogging to get the stackinfo, maybe it is helpfull for you as well.
>
>Regards,
>Koen
>
>
>Local lcCurPrg, lcLine, lcModLine, lcModule, lcSource, lcSrcCode, lcStack, lnStck
>Local array aStk[1]
>
>= Astackinfo(m.aStk)
>*
>lcLine = Chr(13) + Chr(10)
>lcStack = ''
>For lnStck = Alen(m.aStk, 1) - 1 To 1 Step - 1
>	lcCurPrg  = m.aStk(m.lnStck , 2)
>	lcModule  = m.aStk(m.lnStck , 3)
>	lcSource  = m.aStk(m.lnStck , 4)
>	lcModLine = Transform(m.aStk(m.lnStck , 5))
>	lcSrcCode = m.aStk(m.lnStck , 6)
>*
>* Create a line of info
>	lcStack = m.lcStack + m.lcNline ;
>	+ m.lcModule + ' (Line: ' + m.lcModLine + ') ';
>	+ '{' + m.lcSource + ' ' + m.lcCurPrg + '}' ;
>	+ iif(Empty(m.lcSrcCode), '', + m.lcNline + '  Code: ' + Alltrim(m.lcSrcCode))
>Endfor
>*   
>RETURN m.lcStack
>
Thanks for the reply.

I had already built an equivalent program for getting the stack info. That's where I found the missing character at the end of the 6th element.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform