Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking variables value sequence
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01283482
Message ID:
01283742
Views:
22
Hi Moises,
Try this
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


*************************************************
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   01/21/08 08:05:08 PM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT text1 AS textbox WITH ;
		Alignment = 3, ;
		Value = 3.56, ;
		Height = 27, ;
		Left = 66, ;
		Top = 10, ;
		Width = 105, ;
		Name = "Text1"


	ADD OBJECT text2 AS textbox WITH ;
		Alignment = 3, ;
		Value = 4.05, ;
		Height = 27, ;
		Left = 81, ;
		Top = 47, ;
		Width = 105, ;
		Name = "Text2"


	ADD OBJECT text3 AS textbox WITH ;
		Alignment = 3, ;
		Value = 3.04, ;
		Height = 27, ;
		Left = 121, ;
		Top = 89, ;
		Width = 105, ;
		Name = "Text3"


	ADD OBJECT text4 AS textbox WITH ;
		Alignment = 3, ;
		Value = 2.99, ;
		Height = 27, ;
		Left = 165, ;
		Top = 135, ;
		Width = 105, ;
		Name = "Text4"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 190, ;
		Left = 71, ;
		Height = 28, ;
		Width = 126, ;
		Caption = "Command1", ;
		Name = "Command1"

	PROCEDURE command1.Click
		FOR lnCount = 1 TO 3
		    IF EVALUATE([ThisForm.Text]+TRANSFORM(m.lnCount  ) + [.Value]) > ;
		       EVALUATE([ThisForm.Text]+TRANSFORM(m.lnCount+1) + [.Value])
		       MESSAGEBOX([The value in Text]+TRANSFORM(m.lnCount+1)+[ is smaller then Text]+TRANSFORM(m.lnCount))
		    ENDIF
		NEXT
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Test this example and if all is OK
replace ThisForm.Text with price

HTH

>I have
>
>price1, price2, price3, price4
>
>They must be filled by the user in growing sequence as in the example below:
>
>5.00, 7.00,8.50,10.00
>
>or
>
>1.00, 100.00,1000.00,5000.00
>
>etc
>
>It must be wrong if any variable is not according to the rule, as below:
>
>4.50, 7.00,3.00,10.00
>
>The message ("price 3 is incorrect") must be shown
>
>Seems simple task, but I tried using < and > and could not
>achieve a satisfatory result
>
>Moises
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform