Tuesday, 7 July 2026

Injecting an English title for a report sent by TTS (2)

Several months ago, I described how an English title could be injected into a report that is sent via TTS. Whilst the code that I displayed there is fine, it transpires that the English text is too long for the report's title and so was being truncated. The solution for this would be to inject the title into the appropriate field in the subform REPTITLE. This makes the code both simpler (because my original solution is no longer needed) and more complicated. It now becomes

:EXE = 0; /* do this once at the beginning */ SELECT EXEC INTO :EXE FROM EXEC WHERE NAME = '$' AND TYPE = 'R'; ... GOTO 10 WHERE SQL.COUNTRY = 'ISR'; /* India */ :MSGNUM = 10; :GROUP = 'INDIAGROUP'; GOTO 20; LABEL 10; /* Israel */ :MSGNUM = 0; :GROUP = 'ISRAELGROUP'; LABEL 20; GOSUB 900; EXECUTE WINACTIV '$', SQL.TMPFILE, 'STACK', :$.STK, '-g', :GROUP; GOTO 99 WHERE :MSGNUM = 0; :MSGNUM = 0; GOSUB 900; /* Remove the injected title */ LABEL 99; /* End */ /***************************************************************/ SUB 900; DELETE FROM REPTITLE WHERE EXEC = :EXE; GOTO 901 WHERE :MSGNUM = 0; :PAR1 = ENTMESSAGE ('$', 'P', 10); INSERT INTO REPTITLE (EXEC, TITLE) VALUES (:EXE, :PAR1); LABEL 901; RETURN;

No comments:

Post a Comment