× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Marco,

Since this is an RPG question, I'm not replying to Midrange-L, but rather to the RPG list. Please send follow-ups there. Thanks!


There are many approaches to this...

1) Instead of using "loaded" as your user-defined "Communication area" parameter, you could pass a data structure. Put all of the static stuff in that DS, and then you could reset it from anywhere.

-or-

2) Keep the stuff as static fields in a procedure, but add an indicator named "reset" or something like that to your user-defined communications data parameter. When it's on, the procedure could easily reset the data.

-or-

3) Same as #2, but use a global variable instead of using the communications area. This is, imho, not as elegant, but some people really struggle to understand the communications area concept, so this would be an alternative.


Thoughts?





On 5/24/2013 11:26 AM, Marco Cecchi wrote:
Hello,

thanks to Scott Klement' s examples now I can parse an XML file, but in case of errors the handler "xml_parse" don't reset some static variables (depth, stackname,stackval), so when I back to my program after "XML Open Error" I find the previous value on these variables, until I logout my user session:

xml-sax(e) %handler(XML_Parse: loaded)
%XML(%trim(filePath): 'doc=file');

P xml_parse B
D pi 10i 0
D loaded 10i 0
D event 10i 0 value
D string * value
D stringLen 20i 0 value
D exceptionId 10i 0 value
D value s 65535a based(string)
D ucs2val s 16383c based(string)
D MAX_DEPTH c 32
D depth s 10i 0 inz(0) static
D stackname s 65535a varying inz('')
D dim(MAX_DEPTH)
D static
D stackval s 65535a varying inz('')
D dim(MAX_DEPTH)
D static

Could someone tell me how to reset them each time I enter the program?

Thanks in advance,

Marcodatacom


Marco Cecchi
DATACOM Srl
Presso Com-Ital Group
Via dell'Artigianato, 28
59013 Montemurlo (PO)
Tel +39 0574 653453
Fax +39 0574 650740

_________________________________________________________________________________________________________________
Ai sensi del D. Lgs. 196/03 si precisa che le informazioni contenute in questa e-mail ed eventuali suoi allegati sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio Vi fosse pervenuto per errore, Vi invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene immediata comunicazione. Grazie.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.