PeterT Posted March 29, 2005 Share Posted March 29, 2005 Hi, I am trying to write a script that adds a user entered number to the end of a specified text string found on the drawing. The Message() line I put just before the Insert() line returns the correct values for the variables plndig and plnlbl, but the Insert procedure is not inserting plndig after plnlbl as I wish. I am not at all familiar with using DYNARRAY of CHAR variables. It seems I can interchange STRING and DYNARRAY of CHAR variables without errors, but I am a bit confused on the whole thing. I get the script to compile, but it does nothing to the "FLOOR PLAN' text block. Can Anyone help with what my code is missing? code: PROCEDURE NumberPlan; VAR plnnum: REAL; FUNCTION PlanNum(lblhndl: HANDLE): BOOLEAN; VAR plndig:STRING; plnlbl: DYNARRAY[ ] of CHAR; objtype, flrpln: INTEGER; BEGIN objtype:=GetType(lblhndl); IF (objtype = 10) {if a text block} THEN BEGIN plnlbl:= GetText(lblhndl); flrpln:=POS('FLOOR PLAN',plnlbl); IF flrpln<>0 {if text block contains 'FLOOR PLAN'} THEN BEGIN plndig:= Num2Str(0,plnnum); {Message(plndig, plnlbl);} Insert(plndig,plnlbl,11); {insert plan number after 'FLOOR PLAN'} END; END; END; BEGIN plnnum := RealDialog('Enter the Plan Number', '1 '); ForEachObjectInLayer(PlanNum,1,0,0); END; RUN(NumberPlan);[/code] Thanks for any input. Quote Link to comment
PeterT Posted March 29, 2005 Author Share Posted March 29, 2005 Oops, I think I just realized I am inserting into a string, not a text block. Maybe I will try SetText to get the information on to the drawing. Any comments still appreciated. 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.