News:

Please note new Forum URL: forum.designcad.com

Main Menu

Problem with Change T_Text

Started by Gymbo, October 02, 2021, 11:55:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gymbo

Test-1A.dcd is a drawing with 2 rows of characters. 1 to 14 are entity numbers 15 to 28 and A to N are entity numbers 1 to 14.

Macro Test-1a.d3m reads a text file with 14 non-repeating random numbers from 1 to 14 into variable num(i). It looks at the first 14 entities and if the letter matches it assigns the entity number to that position. It works great!
 
Next the macro needs to remove the number of the entity used to replace the letter. This is where the problem is. If I comment out the portion of the macro the replaces the number with "", the macro works fine, with the comments removed it comes up with a syntax error. This is the code:

INCLUDE "dcadalias.d3i"
Precision 0
dim num(23)
open "I", 1, "N:\Star Puzzles\star7.txt"
for i = 1 to 14
input #1, num(i)
next
close 1

i = 1
for j = 1 to 14

GetAttr j, type, select, laynum, group, red, green, blue, solid
entity j
ltr$ = sys$(1)

if ltr$ = "B" or ltr$ = "D" or ltr$ = "F" then
PutAttr j, 13, 0, 2, Group, 0, 0, 0, solid
a$ = num(i)
change t_text, a$
update

for h = 15 to 28
GetAttr h, type, select, laynum, group, red, green, blue, solid
entity h
ltr$ = sys$(1)
if ltr$ = a$ then
a$ = ""
putattr h, 13, 0, 0, group, red, green, blue, solid

Change T_Text, a$
update
end if

next
end if

    i = i + 1
Next

>FitToWindow
{
}
end


Can anyone tell me what I'm dong wrong?

Regards,

Jim

Gymbo

Regards,

Jim

Gymbo

Duh, "" (null) doesn't work, but " " does, can't tell you how long I've worked on this.
Regards,

Jim