PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Composite string questions  (Read 479 times)

Peter.Higgins

  • Gold Member
  • ****
  • Posts: 66
    • View Profile
Composite string questions
« on: February 10, 2020, 10:15:19 AM »

Is the documentation up-to-date re sub-scripting with composite strings?
Is there a convenient way to determine if a variable has been dimmed as a composite string?

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3350
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Composite string questions
« Reply #1 on: February 10, 2020, 11:41:25 AM »
An easy way to determine if a string is real or a composite is to ask for its IOLIST using the IOL function as in

X$ = IOL(string$, ERR=Non_Composite)

As for your question about documentation, we are curious what you are looking for and/or trying to accomplish.

Peter.Higgins

  • Gold Member
  • ****
  • Posts: 66
    • View Profile
Re: Composite string questions
« Reply #2 on: February 10, 2020, 02:36:16 PM »
Mike,

I am adding new programs onto some old code that writes string record followed by numeric arrays.
The calls and objects usually get the entire string record portion even when only one field is used.
New work is designed to be more maintainable by use of record IO and composite string variables.
These generally have to be integrated with the existing calls. 

Passing composite strings into lightly modified sub calls/objects would be helpful if this is an actual supported feature. My testing indicates this maybe possible, but the documentation says otherwise.




Thomas Bock

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Re: Composite string questions
« Reply #3 on: February 11, 2020, 05:53:22 AM »
Peter

I'm not sure what you mean.
As long as you use call-by-reference the iolist will be accessible inside a called module:

Code: [Select]
begin
dim structure$ : iolist product$, version$
structure.product$ = "PxPlus"
structure.version$ = "16.2"
call pgn + ";ENTRYPOINT", structure$
end
ENTRYPOINT:
enter composite$
print composite.product$
print composite.version$
exit

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3350
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Composite string questions
« Reply #4 on: February 11, 2020, 10:24:06 AM »
Peter

I did a quick look at the CALL directive in the documentation and didn't see any reference to composite strings.

You mentioned "My testing indicates this maybe possible, but the documentation says otherwise.", can you let us know where in the documentation it states otherwise so we can adjust it as needed to avoid any confusion going forward?

Peter.Higgins

  • Gold Member
  • ****
  • Posts: 66
    • View Profile
Re: Composite string questions
« Reply #5 on: February 14, 2020, 01:58:53 PM »
Mike,
Where the manual is unclear if composite strings support substrings.
Manual.pvxplus.com
DIM > Format 2> Define Composite String
Composite Strings vs. BBx® Templates

The system does not currently support subscripting with composite strings.

Perhaps this applies not to substrings but to arrays??