- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- HP Pascal SELECT and SELECTONE expressions
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2007 11:40 AM
02-06-2007 11:40 AM
I'm writing a Pascal program which uses the SELECT and SELECTONE statements introduced in HP Pascal V6. The only documentation I can find is the description in the Release Notes and there's something I need clarified.
I'm assuming that the data types of the 'select-selector' expression and the 'select-label-list' expressions have to be the same, or at least type-compatible. But do they have to be ordinal types, or can they be more complex? For example, can these expressions be character strings?
(Yes, I know I can do this by making the 'select-selector' the boolean constant TRUE and then having each 'select-label-list' consist of string comparisons producing TRUE or FALSE results.)
Thanks,
Jeremy Begg
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2007 07:22 PM
02-06-2007 07:22 PM
Re: HP Pascal SELECT and SELECTONE expressions
you are right. There is no documentation online (yet).
I would expect to find the documentation for Pascal V6 on the following page:
http://h71000.www7.hp.com/doc/pascal.html
regards
Heinz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2007 12:20 PM
02-07-2007 12:20 PM
Re: HP Pascal SELECT and SELECTONE expressions
I'd expect ordinal types, but then HP Pascal frequently surprises me in the way it pushes boundaries ;-)
I expect you'll get an authoritative answer from John Reagan soon...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2007 01:56 AM
02-08-2007 01:56 AM
SolutionAn outstanding wishlist item was to CASE on character strings. Something like:
CASE string-expression OF
'ABC': stmt1;
'DEF': stmt2;
END;
However, I would have to start dealing with errors like:
CASE string-expression OF
'ABC': stmt1;
'DEF': stmt2;
'ABC ': stmt3;
END:
While trying to figure out the best place to do that (the internal structures were not prepared for string values), I mumbled to myself "Gee if only CASE could just do the FIRST one it found, then I wouldn't have to do any checking at all. Just dump the 'problem' back on the user." (I'm such a nice guy, eh?)
While in the compiler looking at CASE, I saw that I use the BLISS SELECT statement (which only takes ordinal values) as:
SELECTONE True OF
SET
[CH$EQL(.Expr,'ABC')]: ...
[CH$EQL(.Expr,'DEF')]: ...
TES;
I said, "Ah, if I allow full run-time expressions and define an 'order of evaluation' for the SELECT parts, that will let me provide a 'CASE over strings' plus with SELECT vs SELECTONE, you can get even more power.
So off I went to re-implement BLISS' SELECT and SELECTONE statements into Pascal.
With that background, the SELECT selector must be an ordinal type. The way you 'CASE on strings' is:
SELECTONE True OF
String-expression = 'ABC': ...
String-expression = 'DEF': ...
END;
John
PS As for adding it to the documenation, we didn't update the docset for V6.0. The release notes is the only place for the information right now. I hope to update it next time as I have a few more customer requests I'd like to add. (spoiler alert: I've had several requests for the compiler to understand/generate 64bit descriptors for conformant array parameters.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2007 12:58 PM
02-08-2007 12:58 PM
Re: HP Pascal SELECT and SELECTONE expressions
Thanks!