Page 1 of 1 1
Topic Options
#203648 - 2011-11-12 10:45 PM Kixtart, Kixforms Duplicate Def's Nul Data...not playing..
MACE Offline
Starting to like KiXtart

Registered: 2004-09-07
Posts: 150
Loc: Manchester UK
I have a dim memory of something like this in the past but I have located no resolution to the problem.
RE: http://www.kixforms.org/forum/viewtopic.php?t=1720
I am not sure whether it is ME, Kixforms/Kixtart or Windows.
Explicit on in all scripts (Jochen) \:\)
I have global constants and flags set in scripts. I don't declare Form page variables as global until in the Function which creates the forms. All Event Functions see the global declarations so I can freely read and update the forms and pass back to KIX for output. The problem is, in Kixforms Classic DLL it does not appear to support .close and when the function closes, unlike KIXtart, the variables seem to remain registered as declared though not accessible so if I re-call the form function it does not simply rebuild but errors saying duplicate definition of form variables. If I set a global flag to indicate whether the form has already been built or not so bypasses re-building, kixtart then cant access the supposidly declared variables. VERY frustrating !
The only way I have, so far, is to re-RUN the script afresh and close the current one - just so I can use the same form again !!
NB: I tried using VARTYPE on re-used form variables and it shows them as Nul.
I also considered writing out temporary scripts and running them to create the forms with routines to write out results to temporary files for reading in the main kix script. Does seem to be a bit of overkill but needs must if its the only means of fixing the problem!

Anyone on the Kixtart side of the equation got any ideas as I need to use kixtart.dll for portability. Can't be installing .Net everywhere !

Top
#203649 - 2011-11-12 11:30 PM Re: Kixtart, Kixforms Duplicate Def's Nul Data...not playing.. [Re: MACE]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
don't see no code.
you say you run a function that declares global variables?
the problem with this approach is that they indeed are declared and on the next run, they will try to do it again -> error.
so, if you really need to have those globals inside that function declaration, you need to test them with isDeclared before declaring them.
_________________________
!

download KiXnet

Top
#203650 - 2011-11-12 11:38 PM Re: Kixtart, Kixforms Duplicate Def's Nul Data...not playing.. [Re: MACE]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
just answered the thread kf.org .. no real solution, sorry.
_________________________



Top
#203651 - 2011-11-12 11:44 PM Re: Kixtart, Kixforms Duplicate Def's Nul Data...not playing.. [Re: Jochen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
also, in addition to my previous reply.
you are little unclear with the variables you are talking about.
every now and then there seems to be writing about form variables.

so, if these variables are kixtart ones, then they basically have nothing to do with kixforms.

what comes to destroying a form, like really really, it needs to be disposed from the kixtart.system if that is used and every reference to it has to be invalidated, like for example what you did with setting the value of the var to 0.
_________________________
!

download KiXnet

Top
#203658 - 2011-11-13 04:15 PM Re: Kixtart, Kixforms Duplicate Def's Nul Data...not playing.. [Re: Lonkero]
MACE Offline
Starting to like KiXtart

Registered: 2004-09-07
Posts: 150
Loc: Manchester UK
Lokero, you are confusing .Net with Classic, .Net does work !
See http://rclarke.net/docs/chm/index.htm?page=source%2Ftabpageevents.htm properties of Forms; there is NO means of closing classic forms or disposing of them !
My exasperation is that iSdeclared is TRUE even though the Function which created the variables has closed.In Kixtart this change of scope clears the variables, not in Kixforms.
If I turn off, contrary to policy, (EXPLICIT,ON) and Comment out Form variable Globals as implied above, get exactly the same result.
Kixtart sees the form construction variables as declared even after the form function has closed.
Looks like I am going to have to get creative and make self generating scriplets so always close on exititing script.


Edited by MACE (2011-11-13 04:18 PM)

Top
#203668 - 2011-11-13 11:07 PM Re: Kixtart, Kixforms Duplicate Def's Nul Data...not playing.. [Re: MACE]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I have never heard from anyone this happening.
so, can you please show some example code.
_________________________
!

download KiXnet

Top
#203680 - 2011-11-14 12:09 PM Re: Kixtart, Kixforms Duplicate Def's Nul Data...not playing.. [Re: Lonkero]
MACE Offline
Starting to like KiXtart

Registered: 2004-09-07
Posts: 150
Loc: Manchester UK
Look Here please:
http://www.kixforms.org/forum/viewtopic.php?p=11913#11913

Top
#203697 - 2011-11-14 05:45 PM Re: Kixtart, Kixforms Duplicate Def's Nul Data...not playing.. [Re: MACE]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Ok.
so, you discovered already that using isdeclared works.

anyways, like said previously, we are talking about kixtart variables, so it has nothing to do with kixforms or forms.
if you want to scope the variables into that function, you need to use DIM.

and, just to make it more confusing, kixforms classic has it's own variables, I think they were called expandos.
anyways, once you dim your $subform1, it will get disposed on exit from that function.

also, $system should have it's own doevents. again, not 100% sure cause it's like 5 years since I last used classic. but if it, it should streamline the code quite a bit.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.156 seconds in which 0.09 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org