Normal Topic [FIXED] Unbound Money Element crash (Read 385 times)
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
[FIXED] Unbound Money Element crash
Oct 24th, 2007 at 12:52am
Print Post Print Post  
[color=#ff0000][size=16][b]This is due to an older 1.x -> 2.0 translation bug that was fixed in 2.0.2. See later in thread for fix instructions.[/b][/size][/color]

I think this week I need to get a new brain.  I've programmed and tested forms months ago using Version 2 and everything worked fine.  Since then I have started programming new forms, tested there programming and the new programming is working fine, except for when I used an @IsBlank() command, and Sesame would crash.  Much testing went into narrowing it down to that error.  Comment out the line and Sesame wouldn't crash.  Not finding an error with the programming, I changed it, and everything worked.  Now I wanted to test all the forms, even going back to the ones completed months ago.

(Since then and now, i've upgraded to 2.0.3)

To start testing everything I go into a form, enter data, get to where I have an specified lookup command, and Sesame crashed.  I got out my trusty programming guide, double checked the code, changed programming that included @IsBlank() since that was a problem earlier.  Still crashed. 

Okay...  So I Commented out the Xlookup command and entered it as XResult command.  tested it, and... (drum roll)...

Sesame crashed.  Looking in the log only shows me unlocking applications, and either saving as or reconciling.  (Went back to the only method of using Sesame itself to check programming so if it crashed, Iwouldn't have to unlock designer before I could look at the programming.)  I am at a loss.  Commenting out the Xlookup without having the XResult command, everything else worked. 

I will enter in my programming for the XLookup in case it is something so nice and simple, I can't find it.
[code]/*
Var vPrice as String
Var vDescription as String
Var vPrice1 as Money
Var vPrice2 as Money

//Look up the Price database and pull out the information for the particular Item Number
vPrice = @XlookupSourceList(@FN, Item_No, "Price!Item Number", "Item Description;Price;Price2")

If @Error      //If this doesn't work, make sure nothing in is the variable "vPrice"
{
     vPrice = ""
}
Else
{
     vDescription = @AccessStringArray(vPrice, 1)            //If this does work, separate out the values for Description, NIST price, 17025 Price
     vPrice1 = @AccessStringArray(vPrice, 2)
     vPrice2 = @AccessStringArray(vPrice, 3)
     Description = vDescription                        //Put the description in the description field

     If LE17 = "Yes"                                    //If field 17025 is "Yes" give 17025 Price
     {
           Price = vPrice2
     }
     Else If LE17 = "No"                              //If field 17025 in "No" give NIST price
     {
           Price = vPrice1
     }
     Else                                          //If field 17025 is neither "Yes" or "No", then have a command prompt ask.
     {
           If @AskUser("Is this a 17025 calibration?", "", "")
           {
                 Price = vPrice2
           }
           Else
           {
                 Price = vPrice1
           }
     }
}
*/

Var vRSID as Int
Var vItemCode as String
Var vDescription as String
Var vPrice as Money
Var vPrice2 as Money

vRSID = @XResultSetSearch(@FN, "Price", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!Item Number = " + Item_No)

If @Error
{
     Writeln("You've screwed up again!!")
}
Else
{
     Description = @XResultSetValue(vRSID, "Item Number")
     If LE17 = "No"
     {
           Price = @XResultSetValue(vRSID, "Price")
     }
     Else if LE17 = "Yes"
     {
           Price = @XResultSetValue(vRSID, "Price2")
     }
     Else
     {
           If @AskUser("Is this a 17025 calibration?", "", "")
           {
                 Price = @XResultSetValue(vRSID, "Price2")
           }
           Else
           {
                 Price = @XResultSetValue(vRSID, "Price")
           }
     }
}
[/code]
« Last Edit: Oct 25th, 2007 at 2:26pm by Hammer »  
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: frequent crashes
Reply #1 - Oct 24th, 2007 at 8:23pm
Print Post Print Post  
Would it be possible for you to send in your dsr and ddt file to support. We will then be able to test your application and figure out what is causing your problem. You can email the design files to support@lantica.com

-Ben
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: [FIXED] Unbound Money Element crash
Reply #2 - Oct 25th, 2007 at 2:41pm
Print Post Print Post  
Hello,

The problem is that the Price element on the Work Order form is not set to display as any type, so setting a value to it is causing Sesame to close. This was a translation issue that was fixed in 2.0.2

In Sdesigner
Open the WorkOrder form
Select the Price element
Go to the Format Tab of the Property Editor
Change the Format Unbound as to Money
Save the form

Your programming is also going to need a few changes done to it. In the XResultSetSearch() there needs to be no spaces inbetween the field name and the equal sign and between the equal sign and the retrieve criteria. !FieldName = Criteria tells Sesame that the field name is "FieldName "(Note the space) and the criteria is " Criteria"(Note the space). Also you are going to need to use the XResultSetClose() command every time you use the XResultSetSearch() command.

Code
Select All
Var vRSID as Int
Var vItemCode as String
Var vDescription as String
Var vPrice as Money
Var vPrice2 as Money

vRSID = @XResultSetSearch(@FN, "Price", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!Item Number=" + Item_No)

If @Error
{
	Writeln("You've screwed up again!!")
}
Else
{
	Description = @XResultSetValue(vRSID, "Item Number")
	If LE17 = "No"
	{
		Price = @XResultSetValue(vRSID, "Price")
	}
	Else if LE17 = "Yes"
	{
		Price = @XResultSetValue(vRSID, "Price2")
	}
	Else
	{
		If @AskUser("Is this a 17025 calibration?", "", "")
		{
			Price = @XResultSetValue(vRSID, "Price2")
		}
		Else
		{
			Price = @XResultSetValue(vRSID, "Price")
		}
	}
	XResultSetClose(vRSID)
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged