- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Use which lexical?
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
01-10-2006 10:18 PM
01-10-2006 10:18 PM
$ sh sym syma
SYMA = " keyword: 57"
i want the number "57"(this length will be changed, sometimes 57(2-bits), or 102(3-bit))
but i can not think out a way to get it through f$element or f$extract...
do you have any idea ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 10:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 10:40 PM
01-10-2006 10:40 PM
Re: Use which lexical?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 10:40 PM
01-10-2006 10:40 PM
Re: Use which lexical?
Assuming the symbol definition only varies after the colon (:),
you have two (2) possibilities:
1. x = f$integer(f$element(1,":",syma))
2. x = f$integer(f$extract(10,f$length(syma),syma))
Regards,
Kris (aka Qkcl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 10:40 PM
01-10-2006 10:40 PM
Re: Use which lexical?
well, use Ian's answer, but F$NUMBER should be replaced by F$INTEGER.
-- and most of the time, you do not need the explicit F$INTEGER at all.
If you need the number without leading zeroes, just use the symbol name. If used in numeric calculations, the value is automagically converted.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 10:55 PM
01-10-2006 10:55 PM
Re: Use which lexical?
x=F$integer(f$element(1,":",syma))
It should be - this is what you get from not copying directly from the terminal window :-)
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2006 11:55 PM
01-10-2006 11:55 PM
Re: Use which lexical?
F$ELEM is the way to go normally.
There is one more technique that is often overlooked (unknown) which can give you the answer quickly: String subtraction!
If you know the exact string for " keyword", let's say "TEST", then the solution can be:
$ syma = " TEST:57"
$ number = syma - " TEST:"
$ show symb number
NUMBER = "57"
$ write sys$output f$type(number)
INTEGER
$ other_number = syma - "TEST" - ":"
$ show symb other_number
OTHER_NUMBER = " 57"
$ write sys$output f$type(other_number)
INTEGER
$
Note also how you do not need to strips spaces or do an explicit integer convert.
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2006 11:15 AM
01-11-2006 11:15 AM
Re: Use which lexical?
i think the lexical function is very great :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2006 11:15 AM
01-11-2006 11:15 AM