May 22, 2006, 03:16 PM
Spenceyou can define the field as First 1,000 and include the field in ' ' when printing.
DEFINE FILE CAR
FIRST 1,000 = SALES;
END
TABLE FILE CAR
PRINT 'FIRST 1,000'
BY CAR
ON TABLE PCHOLD FORMAT HTML
END
May 23, 2006, 03:29 AM
Tony AWe're now getting to the situation where something that shouldn't work, does.
All I would say is beware, because if you start to rely upon it you will soon find that in subsequent releases the behaviour will be tightened and you may find it no longer works.
Rule no.1 - Use undocumented features at your own risk!
T (harbinger of doom)
May 23, 2006, 09:04 AM
Spencethis has always worked in the focus language way before webfocus.
May 23, 2006, 09:12 AM
Tony ASpence,
The important thing is - is it a documented syntax?
I would guess the answer is no and therefore that is why I suggest caution.
T
May 23, 2006, 09:57 AM
SpenceT, I understand your point that this may be an undocumented feature. There have been file structures that allow for a field name to contain a space. In order for FOCUS to print a field with a space it needs to be included in single quotes.
SET ASNAMES = ON
TABLE FILE CAR
PRINT SALES AS 'CAR SALES'
BY COUNTRY
ON TABLE HOLD
END
? HOLD
TABLE FILE HOLD
PRINT 'CAR SALES'
BY COUNTRY
END
-EXIT
May 23, 2006, 10:11 AM
Tony ASpence, I agree that the method that you have shown works and I find it very tempting to utilise that quirk, however, the following is from 4.3 documentation -
Valid characters in a name. All names must begin with a letter, and can include any combination of letters, numbers, and underscores ( _ ).
The names of applications, virtual servers, and deployment scenarios can also include embedded spaces. (Other types of names cannot include spaces.)
All I say is user beware.
T
May 23, 2006, 10:18 AM
Tony AHaving said that .......
In the Creating Reports manual (7.1) page 10-15 states -
Special characters and
blanks used in the AS phrase are preserved in the field name that is created when SET ASNAMES is used. Use single quotation marks around the non-standard fieldnames when refering to them in the newly created Master File.
So it would appear that there is some documentation to support it's usage. Well done!
T
May 23, 2006, 11:55 AM
reFOCUSingSweat this works in PDF too.