Main Board > Programming

Help with Initial Value Load Error



I'm working on a software for a client but I'm having an issue with a Listbox.

The program goes from:
-Log in Screen
- - Main Menu
- - - Chart of Accounts

When I enter the COA panel it loads everything well, the panel has only one listbox.

The problem is that when I pickup something from the listbox and close the panel, then reopen it, it gives me the following error:

Unable to set initial value for Listbox @(etc,etc)
Value that failed is etc,etc (whatever record I picked before closing)
Then I just click "Ok" on the screen error and the panel keeps running normally, how can I skip that initial value?
Is there a command or something to release that value when closing the panel so that when I open the panel again it does not try to find what was selected before?

Thank you very much!

James Zukowski:
If you're use PROCESS to work the panel, then all variables should be cleared when you exit the panel. Alternatively, when you initialize the panel, before you load the listbox, be sure to clear all of the field variables.

WOW! Amazing, I was using CMD_STR$="UPanelName" to open the panel from the menu but changing it to PROCESS fixed the listbox error, THANKS A BUNCH!, I gotta try the other methods too just in case.

Mike King:
The CMD_STR$="U...." loads the designated panel passing it all the current variables and leaves both panels active -- that is the controls on each panel are all active and they share a common environment (variables).

The PROCESS command is basically like a CALL.  The current panel will be deactivated and panel designated will be loaded and displayed with its set  of variables.  Only controls on the new panel will be active.  When the user closes the panel control will return to the program/panel that initiated the PROCESS directive.  Now you can pass values on the PROCESS command, these will be mapped into the variables ARG_1$, ARG_2$, ... in the new panel using the same rules as a CALL directive in terms of passing arguments.


[0] Message Index

Go to full version