Just an example of a macro to generate lines of BASIC code.

Results first, followed by the code.

*Results*
[image: Screenshot 2023-08-12 2.20.28 AM.png]
*Code* *(if viewing in Google Groups, ignore the leading and trailing 
triple-backticks)*
```
\define AREA(string)

<$let points="$string$"
         count={{{ [[$string$]split[ - ]] +[count[]] }}}>

<$list variable="element" filter="[range[1],<count>]">
<$text text={{{ [<element>match[1]then<points>split[ - 
]nth[1]addprefix[PSET ]] +[addsuffix[ : AreaStartX = POINT(0) : AreaStartY 
= POINT(1)]]  }}}/>
<$text text={{{ [<element>!match[1]then<points>split[ - 
]nth<element>addprefix[LINE - ]] }}}/><br>
</$list>
LINE - (AreaStartX, AreaStartY)

</$let>

\end

<Main 🟠🟠🟠>

`<<AREA "(25,10) - (50,20) - (0,20)">>`
<<AREA "(25,10) - (50,20) - (0,20)">>

`<<AREA "(50,25) - STEP (20,15) - STEP (-10,15) - STEP (-10,-10)">>`
<<AREA "(50,25) - STEP (20,15) - STEP (-10,15) - STEP (-10,-10)">>
```

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6f888089-ecf8-4f9f-a79f-3d0dab7bc5b6n%40googlegroups.com.

Reply via email to