Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric overflow
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01116716
Message ID:
01116732
Views:
15
But from that what I read (or undestood) Chaim wants to raise error 39, not to handle it. May be I am wrong.

>
>function CurErrHandler
>lparameter tnErrorNum
>if not 'vfpevent.fll' $ lower(set('library'))
>	set library to vfpEvent.fll additive
>endif
>if m.tnErrorNum = 39 && Numeric overflow
>	local lnFields, lnI, lcAlias, lnRecord, lnResult
>	lcAlias = alias()
>	lnFields = afields(laFields,m.lcAlias) && assuming the table is opened
>	lnRecord = recno(m.lcAlias)
>	for lnI=1 to m.lnFields
>		if inlist(laFields[m.lnI,2],'N','I','B','Y','F') and ;
>				"*" $ transform(evaluate(m.lcAlias+"."+laFields[m.lnI,1])) && This is a field, which gave an error
>			lnResult =  EventMBox('Field '+ laFields[m.lnI,1]+" would be blanked because of numeric overflow "+ ;
>				chr(13)+"on the record "+transform(m.lnRecord)+" in file "+dbf(m.lcAlias)+ ;
>				chr(13)+"Do you want to continue the appending process?", ;
>				MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON1, ;
>				"Error is encountered!", ;
>				"&Proceed", ;
>				"&Stop", "")
>			blank field (laFields[m.lnI,1])
>			pnNumberOfProblems = m.pnNumberOfProblems + 1 && Increment number of problems
>
>			if m.lnResult = IDNO && Stop
>				plHalt = .t. && Stop the process
>			endif
>		endif
>	next
>	return
>else
>	error m.tnErrorNum && produce an error and handle it by normal error Handler
>endif
>
>From some of my prev. life applications <g>
>
>I'm cc-ing the thread's originator.
>
>
>>>Hi
>>>Can I tell vfp: when you want to give me the error message 'Numeric overflow' (error 39), fill the field with 0 (in all of the code without adding the line if between(field.value,-9999,99999999) for each case).
>>>Thanks
>>
>>ERROR 39
>>
>>See Error command in Help.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform