how to append/prepend a string or a symbol without any space?

prko's icon

Dear advanced users,

In the attached patch, I get the following message:
adc~ 1 .lim

I need, however, the following strings without two spaces:
adc~1.lim

How can I get this string line?

best,
prko

{
    "boxes" : [         {
            "box" :             {
                "maxclass" : "button",
                "patching_rect" : [ 150.0, 20.0, 20.0, 20.0 ],
                "id" : "obj-2",
                "numinlets" : 1,
                "numoutlets" : 1,
                "outlettype" : [ "bang" ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "message",
                "text" : "1",
                "patching_rect" : [ 148.0, 47.0, 32.5, 18.0 ],
                "fontsize" : 12.0,
                "id" : "obj-1",
                "numinlets" : 2,
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
,         {
            "box" :             {
                "maxclass" : "message",
                "text" : "adc~ 1 .lim",
                "patching_rect" : [ 28.0, 146.0, 138.0, 18.0 ],
                "fontsize" : 12.0,
                "id" : "obj-18",
                "numinlets" : 2,
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "append .lim",
                "patching_rect" : [ 148.0, 110.0, 73.0, 20.0 ],
                "fontsize" : 12.0,
                "id" : "obj-17",
                "numinlets" : 1,
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "prepend adc~",
                "patching_rect" : [ 148.0, 78.0, 84.0, 20.0 ],
                "fontsize" : 12.0,
                "id" : "obj-16",
                "numinlets" : 1,
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "fontname" : "Arial"
            }

        }
],
    "lines" : [         {
            "patchline" :             {
                "source" : [ "obj-2", 0 ],
                "destination" : [ "obj-1", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-1", 0 ],
                "destination" : [ "obj-16", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-16", 0 ],
                "destination" : [ "obj-17", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-17", 0 ],
                "destination" : [ "obj-18", 1 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
]
}

Luke Hall's icon

Just a few things to note: this is the development forum page for issues with writing your own max object externals in C or C++. For general questions use the MaxMSP forum in the General section. Also in max5 you should paste your patches to the forum using "copy Compressed" from the Edit menu as it takes up less space.

To fromat strings without spaces look at [combine] and [sprintf]. I would do something like this [sprintf adc~%ld.lim]. I hope it helps.

lh