Focal Point
[SOLVED] Maintain Error: Datatypes not supported for comparison operation.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2301005713

February 09, 2009, 04:22 PM
brjohnson
[SOLVED] Maintain Error: Datatypes not supported for comparison operation.
I have the following code in an event handler that keeps producing the error "Datatypes not supported for computational/comparison operation."

 IF SEC1 NE '' THEN BEGIN
	OrderStk(1).CRS_SECTION = SEC1;
	OrderStk(1).QTY = QTY1;ENDBEGIN 


SEC1 is defined as A0. I'm just checking to see if there is any data in SEC1, and if so to assign it to a field in a stack. I'm not sure why this isn't allowed.

I know this is the code that is causing the error, because if I remove that code the error goes away.

Any one know why maintain is not allowing this simple comparison?

This message has been edited. Last edited by: brjohnson,


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
February 09, 2009, 08:54 PM
Waz
Bryan, the code seems OK, but what are the formats of the stack fields and the QTY1 field.

What sort of event handler is it? I assume it is set the run Maintain code not JS etc.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 10, 2009, 07:13 AM
GamP
Bryan,

Tested your code, and it ran without any problem.
But, as Waz already mentioned, we don't know what the formats of the various fields are.
And this may even be caused by something that is also in this event handler, so maybe post your entire handler code?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 10, 2009, 12:42 PM
brjohnson
The entire event handler code is:
 Case OnbtnNext_Click
Compute TheDate = today2();
COMPUTE C/I8= 1;
REPEAT SelectedBooksNCourses.FOCCOUNT; SelectedBooksNCourses.FOCINDEX = 1;
COMPUTE I = 1;
	REPEAT WHILE I LE SecCount;
		COMPUTE OrderStk(C).ISBN = SelectedBooksNCourses(SelectedBooksNCourses.FOCINDEX).ISBN;
		COMPUTE OrderStk(C).TITLE = SelectedBooksNCourses(SelectedBooksNCourses.FOCINDEX).BOOK_TITLE;
		COMPUTE OrderStk(C).INSFNAME = FirstName;
		COMPUTE OrderStk(C).INSLNAME = LastName;
		COMPUTE OrderStk(C).TERM = SelectedBooksNCourses(SelectedBooksNCourses.FOCINDEX).TERM;
		COMPUTE OrderStk(C).CRS_NAME = SelectedBooksNCourses(SelectedBooksNCourses.FOCINDEX).CRS_NAME;
		COMPUTE OrderStk(C).ADDDATE = TheDate;
		COMPUTE C = C + 1;
		ENDREPEAT I = I + 1;
ENDREPEAT SelectedBooksNCourses.FOCINDEX = SelectedBooksNCourses.FOCINDEX + 1;



IF SEC1 NE '' THEN BEGIN
	OrderStk(1).CRS_SECTION = SEC1;
	OrderStk(1).QTY = QTY1;ENDBEGIN


COMPUTE NEXT_FORM = 'Test';
		self.WinClose();
EndCase 

The code isn't completely finished, but I wanted to get this part working before I added anything to it. It is maintain code not JS.

OrderStk.CRS_SECTION is defined as A50v
OrderStk.QTY is defined as I11
SEC1 is defined as A0
QTY is defined as I11


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
February 10, 2009, 02:43 PM
Maintain Wizard
I have a couple of questions:

1) In your example you say that QTY is an I11, but in the code you have QTY1. Is this just a typo?
2) What is the format of TheDate and OrderStk(C).ADDDATE ?
3) What is the format of SecCount?

I THOUGHT that maybe the problem was equating a A50V with an A0, but that's not causing me any problems. If you want, zip up the MNT files, MAS files and Other files and send them to:
MARK_DERWIN@IBI.COM and I will try to debug here.

Mark
February 10, 2009, 03:04 PM
brjohnson
quote:
1) In your example you say that QTY is an I11, but in the code you have QTY1. Is this just a typo?
2) What is the format of TheDate and OrderStk(C).ADDDATE ?
3) What is the format of SecCount?


1) Just a typo. QTY1 is defined as I11.
2) TheDate / A10 OrderStk.ADDDATE / HYYMDs
3) SecCount / I8.

This message has been edited. Last edited by: brjohnson,


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
February 10, 2009, 03:17 PM
Maintain Wizard
I'm going to assume you meant OrderStk.ADDDATE / HYYMDs and not HYMMDs. I still don't see the problem. If I had to guess I would assume it's the AnV format field.

I will be happy to debug here. Just zip up the files and send them to me at Mark_Derwin@ibi.com.

Mark
February 17, 2009, 02:40 PM
brjohnson
Well by moving the code from behind the event handler to a function on the mnt I was able to workaround this error.

I don't know why this error was occurring, but since I've gotten around it...moving on.


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML