Subscribe to this thread
Home - General / All posts - M9 - StringJoinTokens funtion to achieve word wrap
steveFitz

340 post(s)
#25-Oct-20 01:51

I'm trying to work out a way to put a list of point IDs in a text control in a layout in M8. Lists can vary from a few chracters to maybe 100 or so and reference which points are on the particular layout page. Before attempting to write a script that maybe aggregates IDs into arrays, etc, I thought I'd checkout what M9 had to offer that would no doubt be simpler and quicker.

I was pleased to find the StringJoinTokens function:

"Passing such personalized separators makes it possible to inject tokens that can be replaced by newline or other characters in output results."

The function aggregates the IDs into individual records for each named Layout (existing in M8 - table exported to M9) but I'm not sure how I could use it to insert newlines every given number of characters.

Or, maybe there is a better way to achieve what I want (?).

Any thoughts or suggestions?

steveFitz

340 post(s)
#25-Oct-20 02:31

That link should be Aggregate Functions

steveFitz

340 post(s)
#27-Oct-20 07:06

Ok, not getting any takers here (sound of crickets in the night).

I've solved the word wrap issue with a script in M8 so perhaps If anyone can help with how to go about writing query for M8 that would concatenate the aggregated query output similar to StringJoinTokens in M9 (example attached).

Or, If not, is there a way to run a query in M9 from M8 so that the results show up in a linked table in 8?

Help greatly appreciated!

Attachments:
TreeIDs per page example_M9.map

Dimitri


7,413 post(s)
#27-Oct-20 07:24

Try connecting from 8 to 9 via ODBC. You can see the result table resulting from a query written in the 9 project. You could then use those results in your 8 project. (Writing this in a rush, hence no details...)

steveFitz

340 post(s)
#28-Oct-20 05:13

Yes, ODBC - I've been using that but in just the way you say but it would be great to not have to open the M9 project to run the update query.

I've looked around other SQL forums and it appears that it is quite a complex task to aggregate data the way the StringJoinTokens function does. Some SQL flavours seem to have special xml output tools, etc.

I'll go with the 2 project approach (8 & 9) for now and maybe attempt to move the whole lot into 9 when I get more au fait with its layout features.

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.