Re: COS.ModalLoop


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Otto Metschar on December 28, 2004 at 17:37:05:

In Reply to: Re: COS.ModalLoop posted by Brian Levantine on December 09, 2004 at 09:11:02:

Hi Brian. I find that it is too awkward to send the whole source for you to recompile because of the size of the programme, therefore I have forwarded herewith the subroutine where I have found the problem is. I found that after running "COS.GetDlgItem" I had to set "cosDlghDlg$ = cosCWnd$" else USR.CommandHandler: will go into an endless loop. This seems to be working for me now.
The reason I tested the 1st byte of cosCWnd$ for null was because I only knew of NullWord$ and not of NullHandle$ when I wrote this.

Seasons Greetings
Otto


!Subroutine Source:
SET.DATA: !Set All Data from Work File to Dialog

FLE$ = "#WINI"+ITERM$
ZX$ = "071134;;040404"
ZERR = 0
OPEN(45) FLE$,EXCPSUB=0001
IF ZERR NE 0 THEN
ABORT = TRUE
ELSE
!
FTYPLIST$ = CNTLFTYP$
IF CNTLFTYP$ = 'S' THEN FTYPLIST$ = 'I'
IF POS(FTYPLIST$,'EI') NE 0 THEN FTYPLIST$=FTYPLIST$+"C" !Include COMBOBOX
DO
ZX$ = "02;;04"
ZERR = 0
KEYWINI$ = KEY(45,EXCPSUB=0001)
IF ZERR NE 0 THEN BREAK
READ(45,WIN2)
IF POS(IFLDTYP$,FTYPLIST$) NE 0 THEN
SELECT CASE IFLDTYP$
CASE "E";"I";"O"
IF STRIP(ISCNTLID$(1)) NE "" THEN !Scroll Lines?
FOR SETARR = 1 TO 17

IF STRIP(ISCNTLID$(SETARR)) = "" BREAK
cosCtlId = NUM(ISCNTLID$(SETARR),ERR)
GOSUB COS.GetDlgItem !Retrieve Handle(Null=Unsuccessful)
!* cosCWnd$ = SUB(cosCWnd$,1,1)
!* IF SUB(cosCWnd$,1,1) NE "@00@" THEN !Retrieve Successful?
!* IF cosCWnd$ NE NullWord$ THEN !Retrieve Successful?
IF cosCWnd$ NE NullHandle$ THEN !Retrieve Successful?
cosDlghDlg$ = cosCWnd$ !Needs to be set else endless loop
cosItemSize = NUM(IDATALEN$,ERR)
GOSUB COS.EditLimitText
cosCtlText$ = STRIP(ISCONTNT$(SETARR))
GOSUB COS.SetDlgItemText !Causes endless ModalLoop
ENDIF
NEXT SETARR
ELSE
cosCtlId = NUM(IWCNTLID$,ERR)
GOSUB COS.GetDlgItem !Retrieve Handle(Null=Unsuccessful)
!* cosCWnd$ = SUB(cosCWnd$,1,1)
!* IF cosCWnd$ NE "@00@" THEN !Retrieve Successful?
!* IF cosCWnd$ NE NullWord$ THEN !Retrieve Successful?
IF cosCWnd$ NE NullHandle$ THEN !Retrieve Successful?
cosDlghDlg$ = cosCWnd$ !Needs to be set else endless loop
cosItemSize = NUM(IDATALEN$,ERR)
GOSUB COS.EditLimitText
cosCtlText$ = STRIP(ICONTENT$)
GOSUB COS.SetDlgItemText !Causes endless ModalLoop
ENDIF
ENDIF
CASE "C"
cosCtlId = NUM(IWCNTLID$,ERR)
GOSUB COS.GetDlgItem !Retrieve Handle(Null=Unsuccessful)
!* cosCWnd$ = SUB(cosCWnd$,1,1)
!* IF SUB(cosCWnd$,1,1) NE "@00@" THEN !Retrieve Successful?
!* IF cosCWnd$ NE NullWord$ THEN !Retrieve Successful?
IF cosCWnd$ NE NullHandle$ THEN !Retrieve Successful?
cosDlghDlg$ = cosCWnd$ !Needs to be set else endless loop
GOSUB COS.ComboGetCurSel
GOSUB COS.ComboGetText
cosItemSize = NUM(IDATALEN$,ERR)
cosCtlText$ = ICONTENT$
GOSUB COS.EditLimitText
GOSUB COS.SetDlgItemText !Causes endless ModalLoop
ENDIF
ENDSELECT
ENDIF
LOOP
ENDIF
CLOSE(45)
RETURN



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):






[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]