|
Hi all,
I have a problem regarding titles exceeding 60 char. To handle this I am using this macro : DEFINE !freq (!POSITIONAL !ENCLOSE ('(',')') / !POSITIONAL !ENCLOSE ('[',']') ) !IF (!LENGTH(!2)<=60) !THEN TITLE !2. !ELSE TITLE !UNQUOTE(!SUBSTR (!2,1,60)). SUBTITLE !UNQUOTE(!SUBSTR(!2,61)). !IFEND FREQUENCIES VARIABLES=!1 /ORDER= ANALYSIS . !ENDDEFINE. However when I run the macro for a title that exceeds 60 characters, I get one page title with 60 char and another one with title (60 char) and a subtitle with the remaining characters. Q1.Why do I get both (title alone and title + subtitle) since the macro evaluates the string length with a conditional if? Q2. Is there a way to put titles wider than 60 char. on a single line in the output document rather than doing it by hand? Many thanks in advance, Erwan Statistician / Data Manager !IF (!LENGTH(!2)<=60) !THEN TITLE !2. !ELSE TITLE !UNQUOTE(!SUBSTR (!2,1,60)). SUBTITLE !UNQUOTE(!SUBSTR(!2,61)). !IFEND FREQUENCIES VARIABLES=!1 /ORDER= ANALYSIS . !ENDDEFINE. However when I run the macro for a title that exceeds 60 characters, I get one page title with 60 char and another one with title (60 char) and a subtitle with the remaining characters. Why do I get both (title alone and title + subtitle) since the macro evaluates the string length with a conditional if? Has anyone had problems with titles wider than 60 to put in reports? Thanks, Erwan |
|
Hi Erwan,
Why are you not QUOTEing the second positional argument (!2)? The syntaxis is : TITLE "This is a title". So why not use: TITLE !QUOTE(!SUBSTR (!2,1,60)). Oh, and I would call the macro '!myfreq' (or something like that) to avoid confusion with the FREQ command. Cheers!! Albert-Jan --- Erwan LE D� <[hidden email]> wrote: > Hi all, > I have a problem regarding titles exceeding 60 char. > To handle this I > am using this macro : > > DEFINE !freq (!POSITIONAL !ENCLOSE ('(',')') / > !POSITIONAL !ENCLOSE ('[',']') ) > !IF (!LENGTH(!2)<=60) !THEN > TITLE !2. > !ELSE > TITLE !UNQUOTE(!SUBSTR (!2,1,60)). > SUBTITLE !UNQUOTE(!SUBSTR(!2,61)). > !IFEND > FREQUENCIES > VARIABLES=!1 > /ORDER= ANALYSIS . > !ENDDEFINE. > > However when I run the macro for a title that > exceeds 60 characters, I > get one page title with 60 char and another one with > title (60 char) > and a subtitle with the remaining characters. > > Q1.Why do I get both (title alone and title + > subtitle) since the > macro evaluates the string length with a conditional > if? > > Q2. Is there a way to put titles wider than 60 char. > on a single line > in the output document rather than doing it by hand? > > Many thanks in advance, > > Erwan > Statistician / Data Manager > > > > > > > > > > > > !IF (!LENGTH(!2)<=60) !THEN > > TITLE !2. > > !ELSE > > TITLE !UNQUOTE(!SUBSTR (!2,1,60)). > > SUBTITLE !UNQUOTE(!SUBSTR(!2,61)). > > !IFEND > > FREQUENCIES > > VARIABLES=!1 > > /ORDER= ANALYSIS . > > !ENDDEFINE. > > However when I run the macro for a title that > exceeds 60 characters, I > get one page title with 60 char and another one with > title (60 char) > and a subtitle with the remaining characters. > > Why do I get both (title alone and title + subtitle) > since the macro > evaluates the string length with a conditional if? > Has anyone had > problems with titles wider than 60 to put in > reports? > > Thanks, > > Erwan > Cheers! Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Did you know that 87.166253% of all statistics claim a precision of results that is not justified by the method employed? [HELMUT RICHTER] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ____________________________________________________________________________________ Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. http://tv.yahoo.com/collections/222 |
|
Quotes are optional in the TITLE command.
In the command syntax help for TITLE, the quotes are inside square brackets-- meaning optional. TITLE [']text['] So this one will work as well. TITLE This is a title. At 06:51 AM 9/3/2007, Albert-jan Roskam wrote: >Hi Erwan, > >Why are you not QUOTEing the second positional >argument (!2)? > >The syntaxis is : >TITLE "This is a title". > >So why not use: >TITLE !QUOTE(!SUBSTR (!2,1,60)). > >Oh, and I would call the macro '!myfreq' (or something >like that) to avoid confusion with the FREQ command. > >Cheers!! >Albert-Jan > >--- Erwan LE D� <[hidden email]> wrote: > > > Hi all, > > I have a problem regarding titles exceeding 60 char. > > To handle this I > > am using this macro : > > > > DEFINE !freq (!POSITIONAL !ENCLOSE ('(',')') / > > !POSITIONAL !ENCLOSE ('[',']') ) > > !IF (!LENGTH(!2)<=60) !THEN > > TITLE !2. > > !ELSE > > TITLE !UNQUOTE(!SUBSTR (!2,1,60)). > > SUBTITLE !UNQUOTE(!SUBSTR(!2,61)). > > !IFEND > > FREQUENCIES > > VARIABLES=!1 > > /ORDER= ANALYSIS . > > !ENDDEFINE. > > > > However when I run the macro for a title that > > exceeds 60 characters, I > > get one page title with 60 char and another one with > > title (60 char) > > and a subtitle with the remaining characters. > > > > Q1.Why do I get both (title alone and title + > > subtitle) since the > > macro evaluates the string length with a conditional > > if? > > > > Q2. Is there a way to put titles wider than 60 char. > > on a single line > > in the output document rather than doing it by hand? > > > > Many thanks in advance, > > > > Erwan > > Statistician / Data Manager > > > > > > > > > > > > > > > > > > > > > > > > !IF (!LENGTH(!2)<=60) !THEN > > > > TITLE !2. > > > > !ELSE > > > > TITLE !UNQUOTE(!SUBSTR (!2,1,60)). > > > > SUBTITLE !UNQUOTE(!SUBSTR(!2,61)). > > > > !IFEND > > > > FREQUENCIES > > > > VARIABLES=!1 > > > > /ORDER= ANALYSIS . > > > > !ENDDEFINE. > > > > However when I run the macro for a title that > > exceeds 60 characters, I > > get one page title with 60 char and another one with > > title (60 char) > > and a subtitle with the remaining characters. > > > > Why do I get both (title alone and title + subtitle) > > since the macro > > evaluates the string length with a conditional if? > > Has anyone had > > problems with titles wider than 60 to put in > > reports? > > > > Thanks, > > > > Erwan > > > > >Cheers! >Albert-Jan > >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >Did you know that 87.166253% of all statistics >claim a precision of results that is not >justified by the method employed? [HELMUT RICHTER] >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > >____________________________________________________________________________________ >Sick sense of humor? Visit Yahoo! TV's >Comedy with an Edge to see what's on, when. >http://tv.yahoo.com/collections/222 |
| Free forum by Nabble | Edit this page |
