Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #12753

Re: Validation in FieldSpec

From JohnMartens <martens@tennishulp.info>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Validation in FieldSpec
Date 2020-01-06 22:00 +0100
Organization A noiseless patient Spider
Message-ID <qv074k$ete$1@dont-email.me> (permalink)
References <94a19123-e370-491b-bce2-8d47b741463e@googlegroups.com> <dc0a8e47-95c7-46f9-96be-6e3d5cbc89e7@googlegroups.com> <quvs0o$6t9$1@dont-email.me> <bb9a23da-385d-453e-9dc2-f6f7fea24741@googlegroups.com>

Show all headers | View raw


I do not know wether this is a proper way do do it but my app has a 
global debugging mode setting. When I want do debug and I would like 
extra info on the program stack then I call TestVersion(TRUE). 
Afterwards you can add an extra line in your code like this

IF TestVersion()
          ErrorBox{self, "Max 14 mg/ml"+GetPrgStack()}:Show()
ELSE
          ErrorBox{self, "Max 14 mg/ml"}:Show()
ENDIF

Then you will get the program stack and you can see which event fires 
the error box. Then you can decide which ones you want and which ones 
you want to avoid creating the error box by adding case of if statements 
in the EFC event of EC event

The GetPrgStack() will only work if you have compiler settings to 
compile ProcName and ProcLine into your app. You will find these in the 
properties setting ons the Compiler tab.

As I said, maybe this not the most elegant way to see where your app is 
but it works for me. Hope this wil help you a step ahead

John



FUNCTION TestVersion(lPar) AS LOGIC
	* function to read the parameter TestVersion
	* the value will be stored with the first call and the value will be 
given back all calls afterwards
	LOCAL STATIC lTestVersie := FALSE AS LOGIC
	IF PCount() = 1
		lTestVersie := lTestVersiePar
	ENDIF
RETURN lTestVersie



FUNCTION GetPrgStack() AS STRING
	* function to return the program calling stack
	LOCAL cPrgStack AS STRING
	LOCAL dwPrgNr AS DWORD
	LOCAL dwPrgStartNr AS DWORD
	*
	dwPrgStartNr := 1
	cPrgStack := ''
	dwPrgNr := dwPrgStartNr
	DO WHILE Len(AllTrim(Psz2String(ProcName(dwPrgNr)))) > 0
		IF dwPrgNr > dwPrgStartNr
			cPrgStack := cPrgStack + Space(1*(dwPrgNr-dwPrgStartNr)+1)+'--> '
		ENDIF
		cPrgStack := cPrgStack + Psz2String(ProcName(dwPrgNr))
		IF ProcLine(dwPrgNr) > 0
			cPrgStack := cPrgStack + '(' + NTrim(ProcLine(dwPrgNr)) + ')'
	  	ENDIF
		cPrgStack := cPrgStack + YOERNEWLINECHAR
		dwPrgNr := dwPrgNr + 1
	ENDDO
RETURN cPrgStack



Op 6-1-2020 om 20:41 schreef zodcomag@gmail.com:
> No, I haven't check.
> Any idea how?
> 
> Henry
> 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Validation in FieldSpec zodcomag@gmail.com - 2020-01-05 14:17 -0800
  Re: Validation in FieldSpec JohnMartens <martens@tennishulp.info> - 2020-01-06 06:50 +0100
    Re: Validation in FieldSpec zodcomag@gmail.com - 2020-01-06 03:40 -0800
      Re: Validation in FieldSpec JohnMartens <martens@tennishulp.info> - 2020-01-06 17:38 +0100
  Re: Validation in FieldSpec zodcomag@gmail.com - 2020-01-06 09:09 -0800
  Re: Validation in FieldSpec zodcomag@gmail.com - 2020-01-06 09:19 -0800
    Re: Validation in FieldSpec JohnMartens <martens@tennishulp.info> - 2020-01-06 18:50 +0100
      Re: Validation in FieldSpec zodcomag@gmail.com - 2020-01-06 11:41 -0800
        Re: Validation in FieldSpec JohnMartens <martens@tennishulp.info> - 2020-01-06 22:00 +0100
    Re: Validation in FieldSpec "Jamal" <noooospam@example.com> - 2020-01-06 17:25 -0500
      Re: Validation in FieldSpec zodcomag@gmail.com - 2020-01-07 02:57 -0800
        Re: Validation in FieldSpec "Jamal" <noooospam@example.com> - 2020-01-07 10:49 -0500
          Re: Validation in FieldSpec Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2020-01-07 17:28 +0100
            Re: Validation in FieldSpec James Martin <james@northwoodlumber.com> - 2020-01-18 14:10 -0500

csiph-web