Page Index Toggle Pages: 1 [2] 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Relational / Combo-Box Programming help? (Read 5335 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #15 - Jul 23rd, 2004 at 3:45pm
Print Post Print Post  
I have to either restart Sesame Server, or recover from a backup when this program fires in Preview mode.
(This is in MFGR On Element Change. Crash occurs when I exit MFGR LE)

var vduped as string
var vstring as string
var vcollections as string
var vcollection as string

//writeln("MFGR On ELEMENT CHANGE now firing. Now populating Collection box.")

if @mode() = 2 and mfgr <> "" then
{
vcollections = @XLookUpAll(@FN, mfgr, "mfgr", "collection")
vduped = @sortstringarray(vcollections, 0)

while @len(vduped)>0
{
if @instr(vduped, ";")>0 then vstring=split(vduped, ";") else vstring = split(vduped, @newline())
if @instr(vcollection, vstring)<1 then vcollection = vcollection + vstring + ";"
vstring = ""
}
populatelistelement(collection, vcollection)
}



Seems like I need a way to only run the program if NOT in Preview mode. It works fine in runtime.

Sorry for all the trouble, but auto populating a combo box is turning out to be a fantastic feature! Next best thing to sliced bread.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #16 - Jul 23rd, 2004 at 4:00pm
Print Post Print Post  
OK. I added:

if xmfgrs <> "" then    //If the lookup worked, then...
{
program....
}

so if the xlookup fails in preview, then the program will Stop. (prevents the crash in preview)

Sorry for all the trouble. Its looking good so far!
Smiley
Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #17 - Jul 23rd, 2004 at 4:44pm
Print Post Print Post  
We'll look at preventing an actual crash in Preview here also.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #18 - Jul 23rd, 2004 at 5:44pm
Print Post Print Post  
That would be a nice thing!

Are the combo boxes working correctly, then? Is nothing supposed to happen while in search mode (except On element Change)

Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #19 - Jul 23rd, 2004 at 5:53pm
Print Post Print Post  
There are only two kinds of code that will run in a Retrieve Spec.
1. Code placed in On Retrieve Spec Open events
2. Code in the OnElementEntry event of a command button

As far as I can see, combo boxes are working correctly. If you were on a Retrieve Spec, you would have seen the symptoms you describe, where the code would run from a command button, but nowhere else. I didn't realize that you were on a Retrieve Spec. I saw the @Mode condition, but it didn't click that you were on a Retrieve Spec.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #20 - Jul 23rd, 2004 at 5:59pm
Print Post Print Post  
Thanks Erika.

Thats important info to know. If it's in the manual, then I skipped right over it.

Thanks for all your help! If you dont' object, I'll post this to the Programming Examples board this weekend. (Although it won't be a polished and efficient as the other examples).

Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #21 - Jul 23rd, 2004 at 6:35pm
Print Post Print Post  
Quote:
Thanks Erika.

Thats important info to know. If it's in the manual, then I skipped right over it.


It's in the Supplement in the section that talks about the new On Retrieve Spec Open event. Page 8.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #22 - Jul 23rd, 2004 at 7:00pm
Print Post Print Post  
Thanks.

I need to study that supplement. I missed lots on lots of  goodies that you pointed out in this thread.

Thanks again for all your 'coaching'

Excellent service, as always.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #23 - Jul 25th, 2004 at 1:46am
Print Post Print Post  
Erika,

The Combo Boxes need major Help!

I've been working with the new "Deadly" stringarray commands on the combo box's almost the entire day trying to allow a user to "drill down" to a specific selection across 4 combo boxes. Making each box auto-populate using xlookups based on the users previous selection.

While I finally got it to do what I wanted, I've crashed sesame probably 50 times or more and permanently damaged a whole slew of working databases. Thank goodness for backups.

I've learned a few things that I thought i should share about combo boxes.

Most of my testing was done in Search mode and each box begins with:

if @mode=2 and box1 <> "" then...

On Element Change is firing during "On element exit" (without making a change) AND "On retrieve spec open". While in Update mode, Pressing f7 to go into search mode, the screen clears, thus firing the combo boxes. Putting @askuser in the On element change causes the mode change to pause. (in my case, xlookups were firing, and possibly colliding.)

Also, pressing f3 in search mode to clear all fields is firing each box. I got around this by adding If box1 <> "" after the @mode=2 condition.

Also, pressing F10 while the cursor is sitting in a box will also cause the box to fire. This is also causing unexpected results and crashes.

I beleive that if you try to run most/all of the new string array commands on a string that does not exist, Sesame will crash. (It should return 0?) Especially Populatelistelement.

After doing a search and returning no results, the On element change fires with each "On entry" and "On exit" event while in search mode. (Then sesame crashes while trying to exit)

I pasted a program from one of the boxes below. The system seems to work great, MOST OF THE TIME. I think the error may occur when no results are found.

Do you have any suggestions?

Thanks
Steve

var vduped as string
var vstring as string
var x as int =1
var vcollection as string
var vstripped as string
var vlist as string
var vfindcounter as int = 0
var vpatterns as string
var vpattern as string
var vdump as string
var vfind as int = 1

if @mode() = 2 and collection <> "" then
{

if @askuser("Collections wants to fire. OK?","","")
{
if mfgr <> "" and collection <> ""
{
vmasterlist= @xlookupsourcelistall(@fn, mfgr, "admin!mfgr", "collection;pattern;color")
if vmasterlist <> ""
{
//writeln("1 vmasterlist = " + vmasterlist)
vlist = @replace(vmasterlist, ";", "|")         
//writeln("2 vlist = " + vlist)
vlist = @replace(vlist, @newline(), ";")
//writeln("3 vlist = " + vlist)
vstripped = @containsstringarray(vlist, collection, 1)  ///build string of ALL matching collections tied to patterns and colors
//writeln("4 vstripped = " + vstripped + @newline())
vstripped = @replace(vstripped, collection, "+")
//writeln("5 vstripped = " + vstripped + @newline())
vstripped = @replace(vstripped, "+|", "")
//writeln("6 vstripped = " + vstripped + @newline())
while @instr(vstripped, "|")>0
{
vpatterns = vpatterns +split(vstripped, "|") + ";"
vdump = split(vstripped, ";")
}
//writeln("7 vpatterns = " + vpatterns + @newline())
if vpatterns <> "" then vduped = @sortstringarray(vpatterns, 0)       //alphebetize the list

//writeln("Vduped list of Patterns = "+vduped)
//vpattern = "test2;test1;"
while @len(vduped)>0                        // strip out the dupes
{
if @instr(vduped, ";")>0 then vstring=split(vduped, ";") else vstring = split(vduped, @newline())
vfind=@findstringarray(vpattern, vstring)
if vfind <1 then vpattern = vpattern + vstring + ";"
//writeln("Final results for combo box :" + vpattern)
vstring = ""
}

if vpattern <> "" then
{
clear(pattern, color)
populatelistelement(pattern, vpattern)      //put the list into the Pattern combo box
populatelistelement(color, "")
}
//writeln("now populate with : "+vpattern)
}
} //end if xlookupsourcelist failed
} //end if not in search mode
}





  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #24 - Jul 25th, 2004 at 1:21pm
Print Post Print Post  
Steve,

Most of the issues you mention with combo boxes are actually the same thing. This is the one I said earlier that we just took care of. The Change event sometimes fires when it shouldn't. We'll also check your other conditions and see if we caught them all.

We are looking the thing where StringArray functions don't appreciate being called on something that isn't one.

I'm most concerned with your statement that any of these issues are actually corrupting your applications. What are you seeing that makes you believe the app is "permanently damaged"? Whatever this is, we want to track it down and make it go away. Can we have one that is in this damaged condition?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #25 - Jul 25th, 2004 at 3:06pm
Print Post Print Post  
Steve,

We've been trying to create your failure conditions, but have not been able to do so. The String Array functions we've tried and looked at are prepared to handle blank values, so we don't think that that is, in itself, the problem. Could you send in your app along with some instructions for how to replicate the problem so we can put it in the debugger and see what you are seeing?

Thanks!
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #26 - Jul 25th, 2004 at 3:14pm
Print Post Print Post  
Thanke Erika,

I want to give you more details on my damaged apps while its fresh on my mind.

When I would reconcile and test my program in runtime, the client would crash and sunlock would not unlock the db. The only way to re-open the db would be to shut down sesame server, unlock, then restart the server.

Since I was connected remotely, this was too time consuming and troublesome, so when it would crash, I would make another change to the programming in dsr, then save as a new application (I wasnt allowed to save over the crashed app).

Then I would open that new application and test it out. (Server still showed the crashed application as being open, while I was working in the new application.)

Somewhere during this process, I got to a point where I couldnt open other forms and pull up a record. As soon as the first record started to show on the screen, Sesame would crash and I would get a message "The instruction at "0x004b38ff" referenced memeory at "0x0170a000". The memory could not be 'written'. Click OK to Terminate the program". Usually followed by the message "The instruction at "0x77f58cdc5" referenced memory at "0xffffffff8". The memory could not be "read". Click OK to terminate the program".

After seeing this, I thought I was having a hardware failure so I moved the app to another computer, and connected from a different client, but same results. I then took out all my combo box programming and tested again. Same thing. I couldn't retrieve any records!

I rolled back to the last 2 or 3 saved apps and they all had the same issues, so I rolled back to a backup from yesterday and all was fine.

I'll email the last ap with the error before I rolled back to a working app. I hope this gave you enough clues to know where to look.

Thanks for listening and responding.

Steve


  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Relational / Combo-Box Programming help?
Reply #27 - Jul 25th, 2004 at 3:22pm
Print Post Print Post  
Steve,

The client crashing does not necessarily take down the Server. The Server may still be running happily with your app still loaded. Sunlocking a validly loaded app is a bad thing to do. You may have simply been able to reconnect a Client and keep working. I suspect that you may, somewhere in all the saving of new apps and sunlocking, forced an overwrite of loaded application files. This would cause much badness.

I don't think your code itself is eating your apps, which I'm quite happy about!
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #28 - Jul 25th, 2004 at 3:29pm
Print Post Print Post  
I just edited my above post slightly. (added a second error message).

Using the Sunlock tool is a pain when working remotely, so I probably only used it when I got the message, "db failed to open".

btw, the unlock feature in the server admin on the client pc rarely has any affect for me. ( cant remember when the last time it actually unlocked the db).

What's been happening A LOT lately, is that the client would crash, but the server did not know it crashed and is still running 'happily'. However, the client can not re-connect to the server and the server still shows the app is 'open'. I'm always having to restart sesame server because a client cant reconnect for this reason, or for some other reason. Probably at this time, I would run sunlock since I'm at the server and its the only convenient time to do so.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Relational / Combo-Box Programming help?
Reply #29 - Jul 25th, 2004 at 3:34pm
Print Post Print Post  
I think your right. I did something to a loaded app that caused a problem.

i thought that an "open ap" was an ap that was in use by a client.  I knew no clients were open, so I thought this was a bad thing and tried to restart or unlock it.

But heres why:

I just crashed twice so I could give you the error messages. The server is still running 'happily', BUT is showing :
Open Applications:
System Database
RugStudio
Rugstudio

This is why I would restart the server. It should not show Rugstudio at all, right? (No clients are open becuase they crashed.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send Topic Send Topic Print Print