sully8391 Posted August 29, 2022 Share Posted August 29, 2022 Hi all. I'm trying to link some text in a symbol to a field of a record format. I've double-triple checked that I have the names of the record format and field correct, but I don't end up with linked fields. I have over 100 fields to link, which is why I'm trying to automate this process. Here's a snippet of the script that's tripping me up: vs.BeginSym("Console Routing") # some other code # for chan in range(64): vs.CreateText(f'input {str(chan + 1)}') vs.LinkText(vs.LNewObj(), "ConsoleRoute", f'Input{chan + 1}') vs.EndSym() Quote Link to comment
Pat Stanford Posted August 29, 2022 Share Posted August 29, 2022 Check that CreateText is actually what is being returned by the LNewObj. After createText add AlrtDialog(Concat(LNewObj, ' ', GetTypeN(LNewObj));l You should get large number which is the handle to the text and the GetTypeN should return 10 if it is a text block. There are some procedures that do create objects but do not properly update LNewObj. If you are not getting the correct text block with LNewObj, search the forum for the Waldo Method. Quote Link to comment
sully8391 Posted September 4, 2022 Author Share Posted September 4, 2022 Thanks for this. It is returning 10, so looks like LNewObj is pointing to a text object. Quote Link to comment
Pat Stanford Posted September 13, 2022 Share Posted September 13, 2022 This seems to work for me. I use the Date(2,2) to get a unique symbol name on each run. vs.BeginSym(vs.Date(2,2)) vs.Rect(0,0,1,2) vs.CreateText('Placeholder') textHandle=vs.LNewObj() vs.EndSym() vs.LinkText(textHandle,'MyRecord','MyField') vs.Record(vs.LNewObj(),'MyRecord') vs.Symbol(vs.Date(2,2),0,0,0); vs.SetRField(vs.LNewObj(),'MyRecord','MyField','Hello') Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.