PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Help with Initial Value Load Error  (Read 283 times)

nrh7

  • On Probation
  • New Member
  • *
  • Posts: 1
    • View Profile
Help with Initial Value Load Error
« on: April 12, 2024, 01:04:08 PM »
Hello

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:

"""""""""""
LOAD 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

  • Diamond Member
  • *****
  • Posts: 308
    • View Profile
Re: Help with Initial Value Load Error
« Reply #1 on: April 12, 2024, 04:08:30 PM »
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.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

nrh7

  • On Probation
  • New Member
  • *
  • Posts: 1
    • View Profile
Re: Help with Initial Value Load Error
« Reply #2 on: April 12, 2024, 06:14:49 PM »
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

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Help with Initial Value Load Error
« Reply #3 on: April 13, 2024, 11:35:31 AM »
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.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com