- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm having a little difficulty. Here's how I started:
Character * 32 test(100), test_hld
now if I want to reference just the first 10 fields of test_hld I can write:
test_hld(1:10) = 'abcdefghij'
here's my problem:
How do I reference the first 10 characters of test?
test(1:10)(5)='1234567890'
did not complie. I've checked everywhere and I can't findout whether or not this is possible. Any help would be appreciated. Thanks.
I'm having a little difficulty. Here's how I started:
Character * 32 test(100), test_hld
now if I want to reference just the first 10 fields of test_hld I can write:
test_hld(1:10) = 'abcdefghij'
here's my problem:
How do I reference the first 10 characters of test?
test(1:10)(5)='1234567890'
did not complie. I've checked everywhere and I can't findout whether or not this is possible. Any help would be appreciated. Thanks.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try test_xxx(5)(1:10). If the char is an array, the first paranthesis is the array element, the second is the char substring.
Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
worked like a charm. Thanks. I'm using MSDEV and could not find the reference for character array access. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Language Reference Manual (on-disk) would have this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It may, but when I looked I couldn't find it. I checked under character and found very little. Nothing listed under ARRAY and the STRING dialog covered other issues. I know you're right I just couldn't find it. What would you look under?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's under Character Substrings in chapter 3. Perhaps not blindingly obvious, but it says:
A character substring is a contiguous segment of a character string. It takes one of the following forms:
v ([e1]:[e2])
a (s [,s] ... ) ([e1]:[e2])
The second is the form you are looking for.
A character substring is a contiguous segment of a character string. It takes one of the following forms:
v ([e1]:[e2])
a (s [,s] ... ) ([e1]:[e2])
The second is the form you are looking for.
![](/skins/images/06022F5BB6D2F28C8F102671A0F06E85/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page