<edit> My apologies folks, it seems I have posted a red herring below. I just tried to revert to my 'original' code and still got the same access violation, so the cause is in some other change I have made, elsewhere than the simpleplot calls. It appears to be associated with a callback function I have introduced. Curiously, I get most information from the release build, but I am as yet unclear as to the problem. I may follow up in due course 😮ops:
</edit>
One of the ways to render ClearWin+ code more digestible is to break it down into a series of continuation statements, each with own individual format code and arguments. This works well as long as individual format codes do not have long standard character strings [blahblah...] associated with them. In this case, a feature that works for some format codes is to append @ instead of [blahblah...] and supply the standard character string as an additional argument - this allows a long string to be assembled neatly and passed as a character variable.
My current issue is that, having dipped a toe in the water of Simpleplot, and got basic graphs working using the %pl format code, I now want to start exerting more control over the result, without (yet) going to the extent of full programmatic control. This means that the list of options is already starting to become quite unwieldy. Whilst it's easy enough to do the brute force continuation line thing, I thought I would see if I could do better.
I established that the @ trick does not work for %pl. Then I hit on a bright idea, of passing the entire format code string '%pl[blahblahblah...]', the first argument to winio@, as a character variable argument instead. So I tried, in an obvious pseudocode:
chapel = '%pl[blahblahblah...] ...' !end result, assembled upstream
i = winio@ (trim (chapel), argument1, argument2, ...)
but this leads to an access violation. I have checked in sdbg that I have assembled the character variable correctly, so as far as I can see, the call above should be precisely equivalent to:
i = winio@ ('%pl[blahblahblah...]', argument1, argument2, ...)
If I don't use trim,and rely on the compiler to lop off the trailing spaces, I get the same result, so it can't be to do with using trim inside the winio@ call.
I haven't ever tried this bright idea on Clearwin+ format codes, and so I don't know if it would also fail there. But I am wondering if the issue is that %pl is a '3rd party' format code, as it were, and thus maybe not subject to the same rules of engagment? I can certainly see that would explain why the @ trick does not work.
Does anyone have any words of wisdom, please?